Question for Larry Mc.
I've created bitmap buttons using the Custom Button Designer (Ebasic version)
Is there any way I can incorporate the bitmap as a resource in creating the button? I've tried the normal way but I can't figure out how I would load a bitmap from memory with:
MYPIC= LOADIMAGE(1,@IMGBITMAP) 'to load into memory conventionally but then,
SetCB_BitMapLM(d1,MyButton,"filepath",0)
I wondered if I should be able to use showimage to show the picture at the button location, but that doesn't work either.
If it can't be done ok, but I expect it may be possible.
Thanks
:)
With the way the code is written it HAS to be from a filename.
One solution would be to add the file as a resource.
When the app is run you could use the resource to recreate the file.
That is, read the resource into a bitmap then save the bitmap to a temp file.
The name of that file would be the one you need.
Then after you get it loaded in the app you could delete the temp file.
If I ever get time to go back to that designer I'll fix it so it can be loaded from a resource.
At the rate i am going I might not ever get back to it.
I'm currently working on the IWB3 IDE.
LarryMc
Thanks for the advice, especially as I know you are really busy with the IWB3 IDE. More than anything I wanted to check I'd not missed something obvious, as the buttons look really good.
WHOOPS! I wrote the text highlighted below before I ported the program to my Desktop computer. Of course, with different screen resolution the mousex and mousey coordinates are different so my "buttons" don't work there.
What should I be looking at to overcome that problem, or would it be easier to go back to your suggestion of sticking with bitmap buttons and writing to disk on opening the program?
I've taken a different route now using "buttons" created from scalable images and then using mousex and mousey to check if the user clicks in that area. Bit more fiddly with the code but works ok.
Thanks again,
:) :)
UPDATE
Sorry, just found this discussion on the forum which shows you how to load a bitmap image from resources to use with a button in 2006. Found MRainey's contribution most useful with the code. Seems to work ok.
http://www.ionicwind.com/forums/index.php?topic=1179.0
thanks