App hangs on LoadPicture when file is corrupt


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: App hangs on LoadPicture when file is corrupt

  1. #1
    Wesley Long Guest

    App hangs on LoadPicture when file is corrupt

    Good morning, group.

    I was wondering if anyone else has noticed that if you try to use the
    LoadPicture method for a Picture Box, and the file you are trying to load is
    corrupt in any way, that the application hangs indefinitely.

    Has anyone else experienced this? Have you found a way to trap for corrupt
    files?

    As always, all help is greatly appreciated.



  2. #2
    Mike D Sutton Guest

    Re: App hangs on LoadPicture when file is corrupt

    > I was wondering if anyone else has noticed that if you try to use the
    > LoadPicture method for a Picture Box, and the file you are trying to load

    is
    > corrupt in any way, that the application hangs indefinitely.
    >
    > Has anyone else experienced this? Have you found a way to trap for

    corrupt
    > files?


    I've experienced the same problem too only in some situations though (And
    annoyingly I can't determine what the cause of those situations are so I've
    no idea of how to detect it) however I've only experienced it (As far as I
    can remember) on bad JPEG images.
    I ended up spending a long time adding a new image import system to my
    application using a combination of different methods to load various
    different images; using my own libraries for BMP (For better support of RLE
    compressed images, LoadPicture() will often just throw large 8-bit RLE
    images out and seldom even attempts 4-bit RLE) and a few other formats.
    Then IJL for JPEG's and finally LoadPicture() for GIF's only (To avoid some
    licensing issues with the format).
    At some point I may get round to releasing the image import/export OCX
    however at the moment there's still a lot of work to be done on it. You'll
    find information on each format over on www.wotsit.org if you want to give
    it a shot yourself though.
    Hope this helps,

    Mike


    -- EDais --

    - Microsoft Visual Basic MVP -
    WWW: Http://EDais.earlsoft.co.uk/
    Work E-Mail: EDais@btclick.com
    Other E-Mail: Mike.Sutton@btclick.com



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center