4月192017
AU3剪切板复制图片
#include <Clipboard.au3>
#include <GDIPlus.au3>
_Clipboard_PutImage("1.jpg")
Func _Clipboard_PutImage($sImage)
Local $hImage, $hBitmap, $hBitmapCopy, $aRet
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
;GDI+ To GDI
$aRet = DllCall('user32.dll', 'ptr', 'CopyImage', 'ptr', $hBitmap, 'int', 0, 'int', 0, 'int', 0, 'int', 0x8 + 0x4)
$hBitmapCopy = $aRet[0]
_ClipBoard_Open(0)
_ClipBoard_Empty()
_ClipBoard_SetDataEx($hBitmapCopy, $CF_BITMAP)
_ClipBoard_Close()
_WinAPI_DeleteObject($hBitmapCopy)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_BitmapDispose($hImage)
_GDIPlus_ShutDown ()
EndFunc ;==>_Clipboard_PutImage```
<br />
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!