08-03-2020, 12:49 PM
Try this:
function str'fileName
opt err 1
#compile "__FreeImage"
FI_ShowMoreErrorInfo
FiBitmap x y
__GdiHandle hb
if(empty(fileName)) fileName = "c:\test.jpg"
CaptureImageOnScreen 1 1 1119 680 "" hb;err ret
x.FromHBITMAP(hb)
y.Attach(FIMG.FreeImage_ColorQuantizeEx(x,0,16,0,0))
y.Save(FIMG.FIF_JPEG fileName)