LoadPicture Function Woes

JDYoder
02-13-2002, 08:14 AM
Usually, the following command is fine...

pic.Picture = LoadPicture("c:\pic.jpg")

However, I've got a problem. If the graphic file is corrupted, it DOESN'T kick out to the error handler, but instead, just hangs the program on that line. If it were actually a text file or something, it errors saying, "Invalid file," but with a corrupted graphic file (could be gif, jpg, bmp) it's completely hanging the program.

So what can I do? Is there any way I can check a file to see if it's a valid graphic file before hitting the "LoadPicture" function? Without having the same results?

violet
04-12-2004, 01:44 AM
you may try to filter the extension name. what i mean is to put a if else statement for the corresponding pictures extension.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum