Sign in to follow this  
Followers 0
Michahe

(GDI-)Graph is moved, after GUICtrlCreateGraphic()

2 posts in this topic

#1 ·  Posted (edited)

When I use a GUICtrlCreateGraphic(), then all draw-commands from the MultiGraph-UDF (include _MG_Graph_initialisieren()) are moved to right, in dependencies of the starting coordinates from the GUICtrlCreateGraphic() before. Can anybody help me, why ?

Why responds GDIPlus to the GUICtrlCreateGraphic() ?

Here is a minimal example and the UDF:
Multigraph_Err_Example.au3
MultiGraph.au3

You can see the difference, if you disable the lines 15-17 in my example. Then the help-grid is moved to original position !

Thanks for your help...
Micha

Edited by Michahe

Share this post


Link to post
Share on other sites



Apparently it has to do with the relative draw-position from the GUICtrlCreateGraphic()-command for a following GUICtrlSetGraphic()-command.
But why does it affect the GDIPlus draw commands ?

What I've found is only the following workaround (create a dummy-control in line 14):

#include <MultiGraph.au3>

Opt("GUIOnEventMode", 1)

Global $IDLed
Global $hGUI

$hGUI = GUICreate("Demo", 1250, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$IDLed = GUICtrlCreateGraphic(520, 13 , 14, 14)
GUICtrlSetGraphic($IDLed, $GUI_GR_COLOR, 0xFF0000, 0xFF0000)
GUICtrlSetGraphic($IDLed, $GUI_GR_PIE, 7, 7, 7, 0, 360)
; create a dummy control to clear the relative position
GUICtrlCreateGraphic(0, 0, 0, 0)
GUISetState(@SW_SHOW)

_MG_Graph_erstellen (1, $hGUI, 80, 160, 500, 280)
_MG_Graph_initialisieren (1)

While 1
    Sleep(100)
WEnd

Func _Exit()
    Exit
EndFunc

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0