|
-
Jul 18th, 2000, 10:49 AM
#1
Thread Starter
Member
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
-
Jul 18th, 2000, 12:56 PM
#2
Thread Starter
Member
-
Jul 18th, 2000, 01:02 PM
#3
Monday Morning Lunatic
Two choices:
1. Make a memory mapped file
2. Create a StdPicture object and shove the data into it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 18th, 2000, 01:04 PM
#4
Thread Starter
Member
which one is faster, and can you show me the code? thanks
-Chris
-
Jul 18th, 2000, 01:07 PM
#5
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 18th, 2000, 01:10 PM
#6
Thread Starter
Member
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 - ?
-
Jul 18th, 2000, 01:16 PM
#7
Monday Morning Lunatic
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 refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jul 18th, 2000, 02:12 PM
#8
Thread Starter
Member
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
-
Jul 18th, 2000, 02:17 PM
#9
So Unbanned
You could always download it to c:\windows\temp then when complete display and delete the file.
-
Jul 18th, 2000, 02:20 PM
#10
Thread Starter
Member
Only problem is writing the file to disk every 100 ms gets very time consuming, and cna't handle multiple threads without slowdown
-
Jul 18th, 2000, 07:10 PM
#11
Monday Morning Lunatic
If this program will only ever be used on your computer, you could set up a RAMDrive, which would stop the 10fps speed problems.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|