CODICE
#include <GDIPlus.au3>
#Include <Misc.au3>
#include <GuiConstantsEx.au3>
#include <ScreenCapture.au3>
$dll = DllOpen("user32.dll")
$whitd=@DesktopWidth ;grandezza finestra
$heigth=@DesktopHeight ;grandezza finestra
$col="0xFF000000" ;colore pennello
$sp=5 ;spessore pennello
$colg="0xFFFFFFFF" ;colore di sfondo non chè colore della gomma
$hGUI = GUICreate("GDI+", $whitd, $heigth)
;GUISetState
GUISetBkColor(0xFFFFFF)
GUISetState(@SW_SHOW+@SW_MAXIMIZE)
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
;$hGraphic = _GDIPlus_ImageGetGraphicsContext ($hImage)
$hBrush1 = _GDIPlus_BrushCreateSolid()
_GDIPlus_BrushSetSolidColor($hBrush1,$col)
Do
$m=MouseGetPos()
If _IsPressed("01", $dll) Then ;colora testo sinistro
_GDIPlus_BrushSetSolidColor($hBrush1,$col)
_GDIPlus_GraphicsFillEllipse($hGraphic, $m[0]-($sp/2), $m[1]-($sp/2), $sp, $sp,$hBrush1)
ElseIf _IsPressed("02", $dll) Then ;cancella tasto destro (gomma)
_GDIPlus_BrushSetSolidColor($hBrush1,$colg)
_GDIPlus_GraphicsFillEllipse($hGraphic, $m[0]-$sp, $m[1]-$sp, $sp*2, $sp*2,$hBrush1)
ElseIf _IsPressed("43",$dll) Then ;scegli colore del pennello [C]
$cols=_ChooseColor(2)
$colss=StringReplace($cols,"0x","")
$col="0xFF"&$colss
ElseIf _IsPressed("47",$dll) Then ;scegli spessore pennello [G]
$sp=InputBox("Spessore","Grandezza:",$sp)
ElseIf _IsPressed("2E",$dll) Then ;resetta schermo Canc
_GDIPlus_BrushSetSolidColor($hBrush1,$colg)
_GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $whitd, $heigth,$hBrush1)
ElseIf _IsPressed("53",$dll) Then ;cambia colore di sfondo [S]
$cols=_ChooseColor(2)
$colss=StringReplace($cols,"0x","")
$colg="0xFF"&$colss
_GDIPlus_BrushSetSolidColor($hBrush1,$colg)
_GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $whitd, $heigth,$hBrush1)
ElseIf _IsPressed("09",$dll) Then ;salva [TAB]
$file=FileSaveDialog("Salva il file",@DesktopDir,"Immagine (*.jpg)")
if @error Then
Else
Sleep(500)
_ScreenCapture_Capture($file&".jpg")
EndIf
EndIf
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_GDIPlus_BrushDispose ($hBrush1)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ShutDown ()