Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RuneLancer

Annoying VB problem - Loading images

This topic is 5647 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is quite an annoying problem I''ve had for as long as I can remember... Whenever I use VB and a picturebox control, some images seem to simply lock up the program (and the whole PC as well x.x). For instance, I''d do something like... MyPic.Picture = LoadPicture(SomePath) Sometimes it''d go fine, but at other times I''ll lock up. It always does it with the same pictures, too. Sometimes the app simply freezes, sometimes the whole PC does. My first idea was that some format wasn''t supported but after some tests, a... for instance, interlaced JPEG would freeze while an other wouldn''t, both saved with PSP. Plus, loading them with other programs (ie, IE for instance) didn''t cause any problems. Now I''m helping a friend out by coding a program to create a gallery (html) via VB. This is quite a pain since he''ll be working with many different images, and lock-ups are kinda unwanted, y''see. So any ideas what I''m doing wrong or what the problem is? Any work-arounds...? Thanks ^^

Share this post


Link to post
Share on other sites
Advertisement
How large are the files? Which file formats have been giving you trouble lately? Is the picturebox set to automatically resize to fit the image?

A quick look at MSDN says that LoadPicture supports..

quote:
bitmap, cursor, icon, metafile, enhanced metafile, or as JPEG or GIF files.


However, I imagine certain formats (or newer ones) may not be supported by the function.

Be a little more specific so we can help you better.


swift URL | browse my bookmarks [server may not always be on]

Share this post


Link to post
Share on other sites
You see, it doesn''t matter which format I use at all. Be it bitmap, jpeg or gif. If I have two files of the exact same type, same version, etc. one could freeze while the other wouldn''t.

As for file formats...

quote:
My first idea was that some format wasn''t supported but after some tests, a... for instance, interlaced JPEG would freeze while an other wouldn''t, both saved with PSP.
Irrelevant.

Yes. I know what LoadPicture supports. It''s not as though I''m new to VB. A file either crashes everything all the time or never, regardless of format or version or even program used to create it; properties given to the picturebox control don''t even make a difference, it''s more as though certain combinations of bytes screw things up (hell if I know; it''s not the format, it''s not the logic or use of LoadPicture, it''s not my controls, I''m kinda out of ideas there).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!