Hi
I have a Window wat is not crated bei PB and so i have only the handle but not the id of the Window.
How i can draw with the drawing functions from PB into this window?
You know for StartDrawing() we must set the WindowOutput() function with the ID of the window, but i don´t have the ID only the handle.
Thanks
Nico
Drawing on a non PB created window?
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Code: Select all
!extrn _PB_2DDrawing_GlobalStructure
Procedure StartDrawingEx(hWindow)
Protected hDC.l
hDC = GetDC_(hWindow)
!MOV EAX, [p.v_hDC]
!MOV [_PB_2DDrawing_GlobalStructure], EAX
ProcedureReturn 1
EndProcedure
Procedure StopDrawingEx(hWindow)
Protected hDC.l
hDC = 0
!MOV EAX,[_PB_2DDrawing_GlobalStructure]
!MOV [p.v_hDC], EAX
ReleaseDC_(hWindow, hDC)
EndProcedure
OpenWindow(0, 0, 0, 640, 480, "Test")
Repeat
StartDrawingEx(WindowID(0))
Box(10, 10, 400, 300, RGB(255, 0, 0))
LineXY(200, 100, 250, 300, RGB(255, 255, 0))
StopDrawingEx(WindowID(0))
Delay(10)
Until WindowEvent() = #PB_Event_CloseWindow

bye,
Daniel
Daniel
-
- Enthusiast
- Posts: 372
- Joined: Sun Apr 03, 2005 2:14 am
- Location: England
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Turn threadsafe off. And visit this link: http://www.purebasic.fr/english/viewtop ... highlight=SoulReaper wrote:does not work here says assembler error...![]()
Undefined symbols...
Good Job though
bye,
Daniel
Daniel
-
- Enthusiast
- Posts: 372
- Joined: Sun Apr 03, 2005 2:14 am
- Location: England