GDI Plus

  • Kannst du mit

    [autoit]

    MouseGetPos

    [/autoit]

    und der Option:

    [autoit]

    MouseCoordMode(2)

    [/autoit]

    denke ich am besten machen.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Danke für den Tipp ... aber ich hätte mich am anfang Besser ausdrücken sollen (mein Fehler).

    Wenn der Mauszeiger auf der Gui in einem bestimmten ereic ist dann soll der mit GDI+ da ein bild mit ner schrift drauf "hinmalen"....

    Aber trotzdem Danke für den Tipp...

    P.S: hab das mit MouseGetPos mal in nem if Probiert :

    [autoit]

    Local $pos = MouseGetPos()
    If $pos[0] = 135 Then
    y()
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Func y()
    If $pos[1] = 150 Then
    label()
    EndIf
    EndFunc

    [/autoit]
  • Meinst du so was?

    Spoiler anzeigen
    [autoit]


    #include <GuiConstants.au3>
    #include <GdiPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    OnAutoItExitRegister("_end")

    [/autoit] [autoit][/autoit] [autoit]

    $Gui = GUICreate("Beispiel", 500, 600)
    $iLabel = GUICtrlCreateLabel("", 11, 10, 188, 23)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($Gui)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Backgrounds\gui_background5.jpg")
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0)
    $hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Backgrounds\gui_background_label.jpg")
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    _GDIPlus_StringFormatCreate(0x0001,0)

    [/autoit] [autoit][/autoit] [autoit]

    $c = 0

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    _end()
    Exit
    EndSwitch
    $aMPos = GUIGetCursorInfo($Gui)
    If IsArray($aMPos) Then
    If $aMPos[4] = $iLabel Then
    If $c Then
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    _GDIPlus_GraphicsDrawString($hGraphics,"Es wurde 'A' 10 mal gedrückt.", 15,12)
    $c = 0
    EndIf
    Else
    If Not $c Then
    _GDIPlus_GraphicsDrawImage($hGraphics, $hImage2, 11,10)
    $c = 1
    EndIf
    EndIf
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _end()
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ImageDispose($hImage2)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯