Results 1 to 4 of 4

Thread: Large JPEGS in VB6 - Out of memory

  1. #1

    Thread Starter
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176

    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
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Large JPEGS in VB6 - Out of memory

    Quote Originally Posted by jcis View Post
    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width