|
-
Sep 14th, 2011, 06:39 AM
#1
Thread Starter
KING BODWAD XXI
Large JPEGS in VB6 - Out of memory
Hello,
I am having trouble with an existing VB6 project and very large jpg files from digital cameras. Recent technology means that we are getting images exceeding 5000 pixels wide and 5000 high, when this occurs we cant load the images into vb as it causes an out of memory error.
Does anyone know of a way I can convert the images down to a smaller size without needing to load them into vb memory first?
The problem has arrisen as customers can transfer their own photos onto the machine via USB, these customers are not normally skilled enough to convert the photos themselves on their own pc's so unfortunately this isnt an option 
Anyone seen this before and have any advice?
Thanks
Paul
-
Sep 14th, 2011, 07:51 AM
#2
Re: Large JPEGS in VB6 - Out of memory
I don't have such large images to test out this idea. But GDI+ may be able to load them from files. If so, it may be possible then to either render it reduced size to a picturebox or resize/save it to a smaller size. Give forum a quick search for: GDI+ JPG
Thought: Are you loading these into a picturebox with the AutoRedraw set to true? If so, try loading them into an image control with the Stretch property set to True instead.
-
Sep 14th, 2011, 08:41 AM
#3
Re: Large JPEGS in VB6 - Out of memory
Weird, i don't think VB sets a limit for pictures in size (disk space or pixel count). Also doing a test with this picture (6000 x 6000 and 2,6 MB) it loaded ok in a PictureBox using LoadPicture(), i'm using Windows XP.
http://imgsrc.hubblesite.org/hu/db/i...-hires_jpg.jpg
Last edited by jcis; Sep 14th, 2011 at 08:44 AM.
-
Sep 14th, 2011, 08:49 AM
#4
Re: Large JPEGS in VB6 - Out of memory
 Originally Posted by jcis
Weird, i don't think VB sets a limit for pictures in size (disk space or pixel count). Also doing a test with this picture (6000 x 6000 and 2,6 MB) it loaded ok in a PictureBox using LoadPicture(), i'm using Windows XP.
When picturebox autorederaw is true, I'd expect an error of some sort if the picturebox is sized several times beyond screen size. Generally, it's something like "automation failure" type of error. AutoRedraw forces an offscreen bitmap to size of picturebox & that size is restricted (either by the system or VB or both). Though the error mentioned by the OP is out of memory. And that may not be related to the image size at all; maybe there is something else going on with manual processing via code that is causing memory leaks? Trying to load like a 100 of them? Everything right now are just guesses
Last edited by LaVolpe; Sep 14th, 2011 at 08:59 AM.
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
|