Basically it is not able to use all 256 colors, just a little more than 140 depending on the image.
Code: Select all
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
#Include Gdip_All.ahk
; Check Gdip is Working
if (!pToken := Gdip_Startup())
{
MsgBox, 0x30, Error, Error starting GDIP
ExitApp
}
Hotkey IfWinActive, ahk_exe game.exe
Hotkey, F2, StartSnapshot
return
StartSnapshot:
if(!WinExist("ahk_exe game.exe"))
{
MsgBox The game is not running!
return
}
WinGet, GAMEHWND, ID, ahk_exe game.exe
pBitmap := Gdip_BitmapFromHWND(GAMEHWND, 1)
pBitmap8bpp := Gdip_CloneBitmapArea(pBitmap, 2, 2, A_ScreenWidth-2, A_ScreenHeight-2, "0x30803")
Gdip_SaveBitmapToFile(pBitmap8bpp, A_WorkingDir "\" A_YYYY A_MM A_DD A_Hour A_Min A_Sec A_MSec ".png")
Gdip_DisposeImage(pBitmap)
Gdip_DisposeImage(pBitmap8bpp)
return
Reference: https://www.autohotkey.com/boards/viewtopic.php?p=391227#p391227
However using IrfanView I got the correct result, but I really don't want to be dependent on it:
Code: Select all
Run, % "i_view64.exe /capture=3 /bpp=8 /convert=" A_YYYY A_MM A_DD A_Hour A_Min A_Sec A_MSec ".png"
I don't know if this is a GDI+ limitation, but if anyone has a solution or way to show me.
I look forward to it and thank you in advance
[Mod action: Moved topic to the gaming section.]