#include <ScreenCapture.au3>
#include <ClipBoard.au3>
$dic=ObjCreate("scripting.dictionary")
If Not IsObj($dic) Then
MsgBox(0,"错误","创建对象失败!")
Exit 0
EndIf
$xls=ObjGet(@ScriptDir&"\Test.xlsx")
If IsObj($xls) Then
_GDIPlus_Startup()
For $pic In $xls.activesheet.shapes
$pic.copy
If $dic.exists($pic.topleftcell.mergearea(1).address(0,0)) Then
$dic($pic.topleftcell.mergearea(1).address(0,0))=$dic($pic.topleftcell.mergearea(1).address(0,0))+1
Else
$dic($pic.topleftcell.mergearea(1).address(0,0))=1
EndIf
$picname=$pic.topleftcell.mergearea(1).address(0,0)&"-"&$dic($pic.topleftcell.mergearea(1).address(0,0))&".jpg"
_ClipBoard_Open(0)
$iVerifyPics = _ClipBoard_GetDataEx($CF_BITMAP)
$iVerifyPics = _GDIPlus_BitmapCreateFromHBITMAP($iVerifyPics)
_GDIPlus_ImageSaveToFile ($iVerifyPics, @ScriptDir&""&$picname)
_ClipBoard_Close()
Next
$xls.close(false)
EndIf
命名的这样就行了,像素的,因为未见到有被缩放的图片,提取的都是100%显示的,似乎一保存就压缩了 |