Jump to content

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

Recommended Posts

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:

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...

Edited by Michahe
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)

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

While 1

Func _Exit()


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...