Copying half of tiff image into new tiff file

Example requests & Code samples for GdPicture Toolkits.
Post Reply
mp33487
Posts: 54
Joined: Wed May 06, 2009 4:26 am

Copying half of tiff image into new tiff file

Post by mp33487 » Wed May 06, 2009 5:08 am

Can you provide me with sample code to copy the lower half of a tiff image and create a new tiff file with the copied area. Thanks in advance.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Copying half of tiff image into new tiff file

Post by Loïc » Wed May 06, 2009 6:33 pm

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim oGdPictureImaging As New GdPicture.GdPictureImaging
        Dim ImageID As Integer

        oGdPictureImaging.SetLicenseNumber("XXX")
        ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("")
        oGdPictureImaging.Crop(ImageID, 0, CInt(oGdPictureImaging.GetHeight(ImageID) / 2) - 1, oGdPictureImaging.GetWidth(ImageID), CInt(oGdPictureImaging.GetHeight(ImageID) / 2))
        oGdPictureImaging.SaveAsTIFF(ImageID, "c:\test.tif", TiffCompression.TiffCompressionCCITT4)
        oGdPictureImaging.ReleaseGdPictureImage(ImageID)
    End Sub

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests