StartDrawing(GadgetOutput())
StartDrawing(GadgetOutput())
I would like this function:StartDrawing(GadgetOutput()) for use DrawAlphaImage on the gadget!
Try this for now, note it's possible to draw outside/beyond the gadget.
I think it's due to some RECT not being properly changed.
But hey, it works, which means it should be possible for the PB team to add GadgetOutput()
althought personally I'd advice using ImageOutput() instead and a imagegadget.
I think it's due to some RECT not being properly changed.
But hey, it works, which means it should be possible for the PB team to add GadgetOutput()

Code: Select all
Procedure.l GadgetOutput(window.l,gadget.l)
Protected wo=0
wo=WindowOutput(window)
PokeL(wo+4,GadgetID(gadget))
ProcedureReturn wo
EndProcedure
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 10, 10, 200, 20, "Standard Button")
ButtonGadget(1, 10, 40, 200, 20, "Left Button", #PB_Button_Left)
ButtonGadget(2, 10, 70, 200, 20, "Right Button", #PB_Button_Right)
ButtonGadget(3, 10,100, 200, 60, "Multiline Button (longer text gets automatically wrapped)", #PB_Button_MultiLine)
ButtonGadget(4, 10,170, 200, 20, "Toggle Button", #PB_Button_Toggle)
Repeat
StartDrawing(GadgetOutput(0,0))
Box(0,0, 10, 10, RGB(255, 0, 0))
StopDrawing()
StartDrawing(WindowOutput(0))
Box(0,0, 10, 10, RGB(0, 255, 0))
StopDrawing()
Delay(10)
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
-
- Enthusiast
- Posts: 326
- Joined: Mon Jan 01, 2007 7:20 pm
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
There's also this interesting post, you can pass it a GadgetID():
http://www.purebasic.fr/english/viewtop ... 73&start=3
http://www.purebasic.fr/english/viewtop ... 73&start=3
BERESHEIT