I uses gdip to get screenshot of my screen.
I sometimes get a "whole black" screenshot from my gdip function, I am wondering is there anyway I can "detect" the returned image is all black, by:
- return a value of 1 if entire screenshot picture is black
- return a value of 0 if not entirely black
here is my gdip function to get screenshot:
Code: Select all
TakePic_Desktop(){
filename := "DesktopScreenshot.png"
SaveImageFromScreen(Filename,0,0,1680,1050)
; If "filename" is all black png, than return 1, else return 0
return
}
#Include Gdip.ahk
SaveImageFromScreen(Filename,X,Y,Width,Height) {
pToken := Gdip_StartUp()
pArg := X . "|" . Y . "|" . Width . "|" . Height
pBitmap := Gdip_BitmapFromScreen(pArg)
Gdip_SaveBitmapToFile(pBitmap,Filename)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
}