Thanks in advance to anybody who might be able to help me get to the bottom of this. I am using Sean's script to save a screen region to a file:
Code:
CaptureScreen("100, 100, 200, 200", false, "yyyy.tif")
Behavior: no matter what the syntax, the image is always saved to the clipboard. After a few hours of troubleshooting, I think I have come close to where the problem might be, but I'm stuck now. Sean's script runs fine all the way to the point of conversion (the parameters are all passed just fine to that point), but it fails to identify the codec that it should use to save my TIF file. How do I know? Right after (Sean's original code):
Code:
DllCall("gdiplus\GdipGetImageEncodersSize", "UintP", nCount, "UintP", nSize)
VarSetCapacity(ci,nSize,0)
DllCall("gdiplus\GdipGetImageEncoders", "Uint", nCount, "Uint", nSize, "Uint", &ci)
Loop, % nCount
If InStr(Ansi4Unicode(NumGet(ci,76*(A_Index-1)+44)), "." . sExtTo)
{
pCodec := &ci+76*(A_Index-1)
Break
}
... I captured the script variables, and got:
Code:
Local Variables for Convert()
--------------------------------------------------
ci[0 of 520]: 啼ᨄᇓ玚
hBitmap[0 of 0]:
hBM[0 of 0]:
hGdiPlus[10 of 63]: 1321533440
nCount[1 of 3]: 5
nQuality[0 of 0]:
nSize[4 of 7]: 1040
pCodec[0 of 0]:
pi[0 of 0]:
pImage[7 of 7]: 4011864
pParam[0 of 0]:
pToken[8 of 63]: 13732484
sDirTo[0 of 0]:
sExtTo[3 of 3]: tif
sFileFr[9 of 63]: 184882698
sFileTo[8 of 63]: yyyy.tif
si[1 of 8]:
sNameTo[4 of 7]: yyyy
wFileFr[0 of 0]:
wFileTo[0 of 0]:
Global Variables (alphabetical)
--------------------------------------------------
0[1 of 3]: 0
ErrorLevel[1 of 3]: 0
As you can see, pCodec, which is used later by gdiplus\GdipSaveImageToFile, is empty. I have no clue why and how to fix it, but I imagine with no codec identified, my TIF file cannot be saved... By the way, I can save the file as a bmp.
Any ideas anyone? I have given up...