|
本帖最后由 sunsunshine2009 于 2021-10-10 11:08 编辑
hotkeyset("{F2}","CutJpg")
while 1
sleep(100)
wend
func cutjpg()
; 图片裁剪白边
; 图片裁剪白边
$ImagePath="C:\aaa.jpg"
_GDIPlus_Startup()
$hBitmap = _GDIPlus_BitmapCreateFromFile($ImagetPath) ;从文件建立位图
$iX = _GDIPlus_ImageGetWidth($hBitmap)
$iY = _GDIPlus_ImageGetHeight($hBitmap)
$hBitmap = _GDIPlus_BitmapCloneArea($hBitmap, 2 * 38, 0 * 38, 15.6 * 38, $iy)
$sCutFileName = StringReplace($ImagetPath, ".jpg", "副本.jpg")
_GDIPlus_ImageSaveToFile($hBitmap, $sCutFileName)
_GDIPlus_ImageDispose($hBitmap)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_Shutdown()
MsgBox(0,"","截图处理完毕!")
filedelete($ImagePath)
endfunc
想在处理完图片之后删除,但是不行,显示被占用,上面代码明明已经释放了,不知道为何,请各位大神指点!
|
|