I'm trying to add in to my exe file all the bitmaps, and that's gone okay.
But I have a region button:
if LoggedIn = 1
hrgn3 = RGNFROMBITMAP(getstartpath() + "menulogout.bmp")
else
hrgn3 = RGNFROMBITMAP(getstartpath() + "menulogin.bmp")
endif
SETCONTROLCOLOR mainmenu,BUT_login,RGB(0,0,0),RGB(0,0,0)
SETBUTTONRGN mainmenu,BUT_login,hrgn3
if LoggedIn = 1
SETBUTTONBITMAPS mainmenu,BUT_login,LOADIMAGE(getstartpath() + "menulogout.bmp",@IMGBITMAP),0,0
else
SETBUTTONBITMAPS mainmenu,BUT_login,LOADIMAGE(getstartpath() + "menulogin.bmp",@IMGBITMAP),0,0
endif
Is there a way to get the above code to use:
1012 BITMAP "c:\\hairdressing\\MenuLogin.bmp"
1014 BITMAP "c:\\hairdressing\\MenuLogout.bmp"
from my resource file instead?
i.e. use say 1012 instead of getstartpath.......
Can't seem to get it to work.
Thanks,
Andy.
:)
The code from Brian's post should work
EXTERN _hinstance as uint
sub load_bitmap(imgno:int,w:int,h:int),uint
string bname
uint hBitmap2
hBitmap2=0
bname="#"+ltrim$(str$(imgno))
hBitmap2 = LoadImageA(_hinstance, bname, IMAGE_BITMAP, w,h, 0)
return hBitmap2
endsub
' Non-tested code
int width = ...
int height = ...
UINT hbit = load_bitmap(1012,width,height)
SETBUTTONBITMAPS mainmenu,BUT_login,hbit,0,0
Fasecero,
Thanks!
Yes that worked, and now my program has all the images embedded into the exe itself, so that's much more tidy.
Thanks again.
Andy.
:)