I am receiving a Byte Array from an internet control - it is a Jpeg. How can I, instead of saving the jpeg to disk and then loading it in the Image control, just directly send the bytes to the image control?
Thanks
-Chris
Printable View
I am receiving a Byte Array from an internet control - it is a Jpeg. How can I, instead of saving the jpeg to disk and then loading it in the Image control, just directly send the bytes to the image control?
Thanks
-Chris
?
Two choices:
1. Make a memory mapped file
2. Create a StdPicture object and shove the data into it.
which one is faster, and can you show me the code? thanks
-Chris
Either way, the problem is that you end up bypassing the built-in JPEG code. To use that, you pretty much HAVE to use a proper file. Although you can get the data in an image array, pass it to a separate JPEG decoder DLL, then display in the picturebox. A memory-mapped file is the faster of the two, but it's NASTY to pull off.
hmm, is there no way to send the image straight to the picture box from memory? (retaining all header info)
I am downloading this image over the Inet control - ?
I'm not sure what stage the JPEG data gets decoded at, so I can't say for sure how to get it in there. If it's possible to put JPEG data into a StdPicture, then it could be done that way, but I doubt it. Intel made a very easy-to-use JPEG decoder library, unfortunately it's for C, but I think a VB wrapper has been created for it.
I have the Jpeg encoder library - is there anyway to use a memory buffer to store the image? or how about DirectDraw/ BitBlt? I want to have up to 9 simultaneous images chnging.
-Chris
You could always download it to c:\windows\temp then when complete display and delete the file.
Only problem is writing the file to disk every 100 ms gets very time consuming, and cna't handle multiple threads without slowdown
If this program will only ever be used on your computer, you could set up a RAMDrive, which would stop the 10fps speed problems.