I am currently working on a small script which captures a screenshot from a hardware accelerated window in BlueStacks.
Problem is, that it appears the window must be hardware accelerated, so the screen capture is saving a black square.
I am using AutoHotkey for my scripting, and have added the GDIp libraries for access to GDI+.
I suspect the problem is that GDIp cannot grab the data using PrintWindow due to the software pushing the frame directly to the GPU, but there must be a way to capture this frame.
My script:
#SingleInstance, Force
#NoEnv
SetBatchLines, -1
OnExit, Exit
#Include Gdip.ahk
#Include GDIpHelper.ahk
SetUpGDIP()
WinGet, hwnd, ID, BlueStacks App Player
pBitmap := Gdip_BitmapFromHWND(hwnd)
Gdip_SaveBitmapToFile(pBitmap, "TestOutput.png", 100)
Gdip_DisposeImage(pBitmap)
return
The actual screen to capture:
The actual file output by my script:
Any ideas on where to go or any kind of instruction on how to access the framebuffer perhaps? It can't be something no one has needed to do before.