Load multiple images

Just starting out? Need help? Post your questions and find answers here.
bbanelli
Posts: 107
Joined: Mon Jul 13, 2015 7:40 am

Load multiple images

Post by bbanelli »

Greetings,

I apologize if this was asked before, but I am having trouble loading multiple images for using them as icons for menu.

Following LoadImage() example -> http://www.spiderbasic.com/documentatio ... image.html I only manage in loading a single image. So if I use the following procedure:

Code: Select all

Procedure LoadImages()
  Debug LoadImage(#ImageRefresh, "img/refresh_update.png")
  Debug LoadImage(#ImageVolonterAdd, "img/user-add.png")
  Debug LoadImage(#ImageVolonterDelete, "img/user-delete.png")
  ProcedureReturn
EndProcedure
Only #ImageRefresh will be used. Further more, I always get "1" as return value, which seems strange?

What is the correct way to load multiple images and use them afterwards in code?
"If you lie to the compiler, it will get its revenge."
Henry Spencer
http://www.pci-z.com/
Fred
Site Admin
Posts: 1821
Joined: Mon Feb 24, 2014 10:51 am

Re: Load multiple images

Post by Fred »

LoadImage() in spiderbasic is defered and requires a callback. You can take a look to the toolbar.sb example to have a way to wait for all you images being loaded:

http://www.spiderbasic.com/documentatio ... ar.sb.html
bbanelli
Posts: 107
Joined: Mon Jul 13, 2015 7:40 am

Re: Load multiple images

Post by bbanelli »

Thx Fred, got it, works like a charm now! :)
"If you lie to the compiler, it will get its revenge."
Henry Spencer
http://www.pci-z.com/
Post Reply