本帖最后由 Ycxw2008 于 2013-6-3 20:50 编辑
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
_Main()
Func _Main()
Local $hGUI, $hBMP, $hBitmap, $hGraphic
; 捕获屏幕的左上角
$hBMP = _ScreenCapture_Capture("", 0, 0, 400, 300)
; 创建 GUI
$hGUI = GUICreate("GDI+",400,300,200)
GUISetState()
$hGUI2 = GUICreate("GDI+",400,300,600)
GUISetState()
; 初始化 GDI+ 库
_GDIPlus_Startup()
; 在 GUI 中描绘位图
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
DllCall($ghGDIPDll, 'uint', 'GdipImageRotateFlip', 'hwnd', $hBitmap, 'int', 1);旋转的函数 具体的查下msdn
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI2)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
; 清理资源
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_BitmapDispose($hBitmap)
_WinAPI_DeleteObject($hBMP)
; 关闭 GDI+ 库
_GDIPlus_Shutdown()
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
|