Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Santman
14
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Oct 2011 02:53
Hi all.

Sorry if this is not needed, but I struggled for a while to get image blocks working (not the best help for those!!) and also to find a thread that explained it. Anyway, I did the old "trial and error" approach and figured it out, so thought I'd share the process in case any other "noobs" had issues.

The part I struggled with was loading them back in, and I found (in my case) that the directory was the issue. Say you have an image, "test.png" stored in a folder called "graphics" in your root. You'd normally load it with something like LOAD IMAGE "graphics/test.png",1

Now, if you add OPEN IMAGEBLOCK "graphics/file",0 before this ("file" being whatever you want the image block to be called, including ANY extension you want if desired), then add CLOSE IMAGEBLOCK after it you'll see the image block is made fine.

Now the confusing part: to load them, you change the open command at the start to OPEN IMAGEBLOCK "graphics/file",1 (again "file" being the name of the one you specified earlier) but STILL USE THE FULL FILE PATH when loading the images i.e. still use LOAD IMAGE "graphics/test.png",1 and the file will still load, even after you delete the actual "test.png" file completely. The reason appears to be (found by reading it as a checklist) that the path becomes a part of the file name itself - so you can move the image block anywhere you want, but must still use the original file path when loading images. Alternatively, change your system path before creating the image block and don't use a directory path and they will load from their name alone. I've managed to add 24 assorted bitmaps and PNG files to one block this way, and re-load them without issue very easily and quickly...and best of all, the files are all nicely hidden!!!

Sorry of this is preaching to the converted, but this took me about 20 mins to figure out, so thought I might be able to save others a few minutes maybe.

Login to post a reply

Server time is: 2026-07-11 14:36:27
Your offset time is: 2026-07-11 14:36:27