Page 1 of 1

Load multiple images

Posted: Wed Mar 23, 2016 11:27 pm
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?

Re: Load multiple images

Posted: Thu Mar 24, 2016 6:44 am
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

Re: Load multiple images

Posted: Thu Mar 24, 2016 7:47 am
by bbanelli
Thx Fred, got it, works like a charm now! :)