what's the wrong with this code it's work sometimes and sometimes it's doesn't work and give me error code 22 at that line of code
- Code: Select all
Call Imaging1.TiffAppendPageFromGdPictureImage(GdViewer1.GetNativeImage(), imageID)
- Code: Select all
Private Sub OpenTiffFileAndAppendToGdViewer()
Dim i As Integer
Dim tifCount As Integer
Dim imageID As Long
cmddlg.FileName = ""
cmddlg.Filter = "*.*"
cmddlg.ShowOpen
If cmddlg.FileName <> "" Then
imageID = Imaging2.TiffCreateMultiPageFromFile(cmddlg.FileName)
tifCount = Imaging2.TiffGetPageCount(imageID)
For i = 1 To tifCount
Call Imaging2.TiffSelectPage(imageID, i)
Call Imaging1.TiffAppendPageFromGdPictureImage(GdViewer1.GetNativeImage(), imageID) ' sometimes it gives error code 22 here
Imaging2.ReleaseGdPictureImageDC (imageID)
Next
Imaging2.CloseNativeImage
Imaging2.CloseImage (imageID)
ShowBitmap
ShowBitmapProperties
End If
End Sub
