ButtonImageGadget()
Syntax
Result = ButtonImageGadget(#Gadget, x, y, Width, Height, ImageID)Description
Create a button gadget in the current GadgetList.
If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by EventGadget() command.
The ImageID represents an a valid image and can be obtained by using ImageID() from the Image library. If ImageID is 0, then no image will be displayed.
You can add a 'mini help' to this gadget by using GadgetToolTip().
- SetGadgetState() can be used to change the current image of the gadget. A valid ImageID can be easily got with the ImageID() command. If the ImageID is 0, then the image is removed from the gadget.
- GetGadgetState() can be used to get the ImageID of the currently displayed image.
Example:If OpenWindow(0, 0, 0, 120, 100, "ButtonImage", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) If LoadImage(0, "map.bmp") ; change 2nd parameter to the path/filename of your image ButtonImageGadget(0, 10, 10, 100, 83, ImageID(0)) EndIf Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf
Supported OS
All