Hi,
I'm new with PureBasic and I didn't figure out how to use SetImageState.
I want to update 2D draw, I can do it by launching ImageGadget again, but the screen will flicker. I read it is possible to use SetGadgetState to make it update, but I don't know hoe to do it.
It would be nice if some could give a coding sample how to use SetGadgetState with ImageGadget to make it update drawing.
Br & Thanks.
ImageGadget + SetGadgetState
Re: ImageGadget + SetGadgetState
Welcome ...
SetGadgetState(Gadget, ImageID(image))
SetGadgetState(Gadget, ImageID(image))
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: ImageGadget + SetGadgetState
Code: Select all
EnableExplicit
Define.i Event
LoadImage(0, #PB_Compiler_Home + "Examples\3D\Data\PureBasicLogo.bmp")
LoadImage(1, #PB_Compiler_Home + "Examples\3D\Data\Textures\Geebee2.bmp")
If OpenWindow(0, 0, 0, 400, 200, "ImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(0, 10, 10, 0, 0, ImageID(0))
ButtonGadget(1, 10, 170, 50, 20, "Change", #PB_Button_Toggle)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
If EventGadget() = 1
SetGadgetState(0, ImageID(GetGadgetState(1)))
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
Re: ImageGadget + SetGadgetState
Works fine, thank you very much!

