What am I doing wrong with _FreeImage? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: What am I doing wrong with _FreeImage? (/showthread.php?tid=1497) |
What am I doing wrong with _FreeImage? - PhilOfPerth - 02-24-2023 I have written a small test using _loadimage and _FreeImage, and all goes well except when I try to clear the images (as I believe is necessary after using them). I get an Illegal function call message at that point. Why is it so??? Code: (Select All) Screen _NewImage(1500, 800, 32) RE: What am I doing wrong with _FreeImage? - bplus - 02-24-2023 Code: (Select All) _FreeImage (a) ' free all of the images from memory Why is the "a" inside ()'s ? _FreeImage is a Sub / Statement not a Function If it's not that, DIM a as Long. Oh! Should be: _FreeImage tiles(a) ' <<< missing tiles RE: What am I doing wrong with _FreeImage? - a740g - 02-24-2023 You should check if all _LoadImage calls are succeeding. I am quite certain that _FreeImage is throwing an "illegal function call" because it is trying to free an invalid image handle. Update: Quote:Oh! Should be: ^this. RE: What am I doing wrong with _FreeImage? - PhilOfPerth - 02-24-2023 (02-24-2023, 01:13 AM)bplus Wrote: The "(a)" is the loop variable. It loads the same image into each of the tiles() positions - there's only one image, called test.jpg ( which I attached - I hope!) Edit: I mis-named the image, by including its path. it should just be "test.jpg". RE: What am I doing wrong with _FreeImage? - PhilOfPerth - 02-24-2023 (02-24-2023, 06:00 AM)PhilOfPerth Wrote:(02-24-2023, 01:13 AM)bplus Wrote: You got it b+! I didn't get what you meant by "missing tiles" - I thought you meant there were tiles missing ( apart from mine ), but then it dawned on me. You were both correct, of course - it was trying to free a mis-named image. Thanks both for your help. |