本帖最后由 zghwelcome 于 2018-9-29 17:37 编辑
下面是我的代码,效率低而且边缘有噪点。求GDI大佬正确的写法该如何写?谢谢!
#include <colorConstants.au3>
#include <ScreenCapture.au3>
Local $iWidth = 550, $iHeight = 550, $iColor = $color_red
_GDIPlus_Startup()
Local $hHBmp = _ScreenCapture_Capture("", 0, 0, $iWidth, $iWidth)
Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp)
For $iY = 0 To $iHeight - 1
For $iX = 0 To $iWidth - 1
_GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, $iColor)
Next
Next
_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\au3生成图片示例一个.jpg")
_WinAPI_DeleteObject($hHBmp)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
|