Hallo,
ich wollte bei gedrückter linker Maustaste ein Auswahlrechteck erzeugen welches beim loslassen
1. die Auswahl in einem neuen Fenster öffnet (vergrössert)
2. die Auswahl als Bild (.jpg) und die Koordinaten des Bilds als Textdatei speichert
naja..aber es passiert nix!
Spoiler anzeigen
#include <Misc.au3>
#include <GDIPlus.au3>
Dim $dll = DllOpen("user32.dll")
Dim $win = _WinAPI_GetDesktopWindow()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($win)
$hPen = _GDIPlus_PenCreate()
While 1
If _IsPressed('01', $dll) Then
$mPos = MouseGetPos()
While _IsPressed('1', $dll)
Sleep(100)
If MouseGetPos() <> $mPos Then
$mPosNew = MouseGetPos()
EndIf
_GDIPlus_GraphicsDrawLine($hGraphic, $mPos[0], $mPos[0], $mPosNew[0], $mPosNew[0], $hPen) ; oben(?)
_GDIPlus_GraphicsDrawLine($hGraphic, $mPos[0], $mPos[1], $mPosNew[0], $mPosNew[1], $hPen) ; unten(?)
_GDIPlus_GraphicsDrawLine($hGraphic, $mPos[1], $mPos[1], $mPosNew[1], $mPosNew[1], $hPen) ; links(?)
_GDIPlus_GraphicsDrawLine($hGraphic, $mPos[1], $mPos[0], $mPosNew[1], $mPosNew[0], $hPen) ; rechts(?)
WEnd
[/autoit] [autoit][/autoit] [autoit]; Auswahlpic speichern mit coords
[/autoit] [autoit][/autoit] [autoit]EndIf
WEnd
DllClose($dll)
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()