tags:

views:

34

answers:

2

I have applicatin in VB 6 and i ask if i can to display image blob from postgres to VB 6

A: 

This code can help if the image can be loaded to a picture box. See the PictureFromByteStream() Function in Module1.bas

renick
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]: http://www.mvps.org/emorcillo/en/code/vb6/index.shtml
wqw
A: 

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.

Bob Riemersma