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?
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?