I have an application written in VB6 and would like to know how I would display an image blob from postgres to VB6?
2 Answers
If the image blob is in one of several standard formats (BMP, JPEG, GIF, TIFF file format) you can use WIA 2.0 for this.
Get the blob as a Byte array, create a WIA.Vector object, assign the Byte array to the Vector.BinaryData property, then you can use the Vector.Picture property to retrieve a StdPicture object you can assign to an Image or PictureBox control.
Comments
This code can help if the image can be loaded to a picture box.
See the PictureFromByteStream() Function in Module1.bas
1 Comment
wqw
The linked code is hacky at best. Try [Load and save pictures to byte arrays][1] for the
IPersistStream way. MS Access is using this when pasting images in BLOBs. [1]: mvps.org/emorcillo/en/code/vb6/index.shtml