Is there a way of getting the current hDC, Brush, Color etc. inside of StartDrawing ... StopDrawing.
As for the hDC, I know that StartDrawing returns this one, but I want to be independent of this function.
hDC, Brush etc.
-
freedimension
- Enthusiast

- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
From the LibrarySDK:
Timo
You should easily be able to access these with !extrn_PB_2DDrawing_CurrentDC ; OS Current DC (HDC)
_PB_2DDrawing_CurrentColor ; Current RGB 24 color
_PB_2DDrawing_CurrentMode ; Current drawing mode (Set by DrawingMode())
_PB_2DDrawing_Brush ; Current brush (for flood fill), set by FrontColor() (HBRUSH)
_PB_2DDrawing_Pen ; Current pen (for outline color), set by FrontColor() (HPEN)
Timo
quidquid Latine dictum sit altum videtur
-
freedimension
- Enthusiast

- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
-
freedimension
- Enthusiast

- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
After all it wasn't that hard:
Thanx a lot
Code: Select all
Procedure GetHDC()
!EXTRN _PB_2DDrawing_CurrentDC
!MOV EAX, dword [_PB_2DDrawing_CurrentDC]
ProcedureReturn
EndProcedure
Code: Select all
CurrentDC.l
!extrn _PB_2DDrawing_CurrentDC
!mov eax, [_PB_2DDrawing_CurrentDC]
!mov [v_CurrentDC], eaxNote: this only works outside of a procedure or with global variables.
This one also works inside: needs InlineASM to be on:
Code: Select all
CurrentDC.l
!extrn _PB_2DDrawing_CurrentDC
MOV eax, [_PB_2DDrawing_CurrentDC]
MOV CurrentDC, eaxI like this solution best: a little procedure:
Code: Select all
Procedure GetCurrentDC()
!extrn _PB_2DDrawing_CurrentDC
!mov eax, [_PB_2DDrawing_CurrentDC]
ProcedureReturn
EndProcedureTimo
[edit]too slow...
quidquid Latine dictum sit altum videtur
-
freedimension
- Enthusiast

- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
No, you helped me a lot, really.freak wrote: [edit]too slow...[/edit]
Especially because of this:
Code: Select all
This one also works inside: needs InlineASM to be on:
CurrentDC.l
!extrn _PB_2DDrawing_CurrentDC
MOV eax, [_PB_2DDrawing_CurrentDC]
MOV CurrentDC, eax
