Screen Capture of Headless Virtualbox Emulator
Posted: 7. Dec 2017, 04:09
Hi.
I am trying to capture the contents of an Android emulator, called MOMO. It is run by VirtualBox Headless Frontend.
I've written a program that uses Gdip_BitmapFromHWND (part of the AutoHotKey scriptting language) to create a bitmap screenshot of any window (even if the window is hidden or off-screen, which is essential) from which I test for certain pixel colours. On my desktop it works fine, including- most importantly- on the MOMO Android emulator on which it is used in order to read pixels from a game. However, on my laptop and for some others, although it can capture the images of other [non-emulator] windows (Notepad, Paint etc) it has a problem with the image from the emulator. Instead of the image that is visible on the screen, it returns an image which is shown during the start-up of the emulator (a full screen advertisement for a game.)
I've spent hours and hours trying to learn/research and discover the problem, but so far to no avail. I thought it may be a DirectX v OpenGL rendering issue, but I've since learned that the MOMO emulator doesn't yet support DiectX. As mentioned, the emulator run in a VirtualBox Headless environment and so I wondered if the problem lay there. I've read some people have had problems with VirtualBox getting the inbuilt SnapShot function working- an issue that goes back years from what I see- and so I didn't know if that was perhaps related. I am a novice with regards to VirtualBox and I hoped someone here may be able to suggest where the problem lay.
Cliffnotes:
-I can capture Bitmap screenshot of VirtualBox Headless emulator on my Desktop (even, most importantly, when the window is hidden or off-screen)
-I *can't* capture Bitmap screenshot of VirtualBox Headless emulator on some other PCs (instead a different image appears- NOT what is visible on the screen.)
-HELP!
Thanks!
I am trying to capture the contents of an Android emulator, called MOMO. It is run by VirtualBox Headless Frontend.
I've written a program that uses Gdip_BitmapFromHWND (part of the AutoHotKey scriptting language) to create a bitmap screenshot of any window (even if the window is hidden or off-screen, which is essential) from which I test for certain pixel colours. On my desktop it works fine, including- most importantly- on the MOMO Android emulator on which it is used in order to read pixels from a game. However, on my laptop and for some others, although it can capture the images of other [non-emulator] windows (Notepad, Paint etc) it has a problem with the image from the emulator. Instead of the image that is visible on the screen, it returns an image which is shown during the start-up of the emulator (a full screen advertisement for a game.)
I've spent hours and hours trying to learn/research and discover the problem, but so far to no avail. I thought it may be a DirectX v OpenGL rendering issue, but I've since learned that the MOMO emulator doesn't yet support DiectX. As mentioned, the emulator run in a VirtualBox Headless environment and so I wondered if the problem lay there. I've read some people have had problems with VirtualBox getting the inbuilt SnapShot function working- an issue that goes back years from what I see- and so I didn't know if that was perhaps related. I am a novice with regards to VirtualBox and I hoped someone here may be able to suggest where the problem lay.
Cliffnotes:
-I can capture Bitmap screenshot of VirtualBox Headless emulator on my Desktop (even, most importantly, when the window is hidden or off-screen)
-I *can't* capture Bitmap screenshot of VirtualBox Headless emulator on some other PCs (instead a different image appears- NOT what is visible on the screen.)
-HELP!
Thanks!