How can I show a JPG image from memory?
I have made an ActiveX that communicates with a web camera. When the ActiveX has received an image from the camera (in jpg format) an event is sent to the VB program that uses the ActiveX. How can I show the jpg from the buffer in the ActiveX in the VB program (picturebox or image)? I do not want to save the image to disk and use the LoadPicture function in VB since the camera is streaming pictures all the time.
Re: How can I show a JPG image from memory?
I made a method in my ActiveX that returned a IPicture* to the VB program and then set the Picture property of a Form to the returned pointer. This works fine but the image quality is not very good. Why?
To try this I let the ActiveX save the picture to disk (jpg file) and then create the IPicture pointer from the same data. Double clicking on the saved JPG file shows an image of the correct quality but if I load the same jpg file to the Picture property of the Form (using LoadPicture function) shows the image with less quality. Why not the same file show in different quality when showing it on the Form?
Re: How can I show a JPG image from memory?
Vb forms work at 256 colours.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Re: How can I show a JPG image from memory?
Could you elaborate it please? I didn't quite get it.
Numinel would you post the code
Hi,
the code you writen (that creates a IPicture from JPG file) is just that i'm looking for. Would you post it here please?
Also it will be interesting if it works with other formats (like GIF for exam).
Thanks a lot