本帖最后由 happytc 于 2011-8-25 23:51 编辑
如下面的代码,画了一条直线,如何删除这条直线?
另外,如何最简单判继鼠标左键UP(左键Down可以用_IsPressed("01") )?不想注册个消息函数来做
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#Include <Misc.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hGUI, $hBMP, $hBitmap, $hGraphic, $MousePosOri, $MousePosNew
$hBMP = _ScreenCapture_Capture ("", 0, 0, @DesktopWidth -350, @DesktopHeight-350)
$hGUI = GUICreate("", @DesktopWidth-350, @DesktopHeight-350, $WS_POPUP, $WS_EX_TOPMOST)
GUISetState()
_GDIPlus_Startup ()
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP ($hBMP)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
_GDIPlus_GraphicsDrawImage ($hGraphic, $hBitmap, 0, 0)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, 0, 200, 200)
Do
If _IsPressed("01") Then
;这里如何写删除上面_GDIPlus_GraphicsDrawLine画的直线,仅仅删直线,别的不删
EndIf
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_BitmapDispose ($hBitmap)
_WinAPI_DeleteObject ($hBMP)
_GDIPlus_ShutDown ()
EndFunc
|