Does gdpicture (SaveAsByteArray & CreateImageFromBy) support multiple tif file?
because up on the below code, it saves only the first page of the multiple tif file, help plz?
1- load multiple tif file from desk
- Code: Select all
CloseImage
Call Imaging1.CreateImageFromFile(App.Path & "\output.tif")
If Imaging1.GetStat = 0 Then
Call ShowBitmap
End If
GdViewer1.SetNativeImage (Imaging1.GetNativeImage)
GdViewer1.ZoomMode = ZoomFitToControl
txtFormat.Text = Imaging1.GetImageFormat
2- save the tif file to database
- Code: Select all
'append the native image of an Imaging object to the OLE field
Dim arBytes() As Byte
Call Imaging1.SaveAsByteArray(arBytes, 0, "tif")
With rs 'recordset
.Fields("ImageData").AppendChunk (arBytes())
.Update
MsgBox "Saved"
End With
Erase arBytes
3- read image from database
- Code: Select all
'---read image from database
Dim arbyte() As Byte
arbyte = rs.Fields("ImageData").GetChunk(LenB(rs.Fields("ImageData"))) 'get image & store in byte
Call Imaging1.CreateImageFromByteArray(arbyte) 'display image in viewer
If Imaging1.GetStat <> 0 Then
MsgBox "There is no bitmap in the byte array"
Else
Call ShowBitmap
ShowBitmapProperties
End If
Erase arbyte
rs.Close
