I'm trying to convert a multipage tiff to individual jpg or png files. The codes works for the most part, but the resulting jpgs and png files are stretched. It's like the orientation switched from normal to landscape.
Any ideas ?
'Read the data is a byte array from the db
Dim result As Byte() = faxQuery.FirstOrDefault.faxImage
'DEBUG: Write out the file exact as it is in the database. This tiff file shows fine in multiple tiff browsers
Dim oFileStream As System.IO.FileStream
oFileStream = New System.IO.FileStream("C:\\fileio.tif", System.IO.FileMode.Create)
oFileStream.Write(result, 0, result.Length)
oFileStream.Close()
oGdPictureImaging.TiffOpenMultiPageForWrite(True)
'Instantiate from the byte array
Dim SrcTiff As Integer = oGdPictureImaging.CreateGdPictureImageFromByteArray(result)
If SrcTiff <> 0 Then
Dim PageCount As Integer = oGdPictureImaging.TiffGetPageCount(SrcTiff)
Dim TiffOutputID As Integer
For i As Integer = 1 To PageCount
oGdPictureImaging.TiffSelectPage(SrcTiff, i)
TiffOutputID = oGdPictureImaging.CreateClonedGdPictureImageI(SrcTiff) 'Even if I comment this out, it doesn't work.
oGdPictureImaging.SaveAsPNG(TiffOutputID, "C:\\fridayafternoon" + i.ToString + ".tif")
Next
End IfUsers browsing this forum: No registered users and 0 guests