Page 1 of 2

Printscreen bug

Posted: 31. Dec 2015, 12:04
by Caesar
If i press host+D and to capture VM screen it capture correctly..
a2(1).jpg
a2(1).jpg (98.24 KiB) Viewed 2415 times
But if i press PrtScn hotkey inside vm, it capture with a white screen, why?
aa1.png
aa1.png (46.09 KiB) Viewed 2415 times
Im running a program that need analyze pixels in this game cliente, but he cant because when he capture the screen it displays only white inside game area :oops: :oops: :oops:

Re: Printscreen bug

Posted: 31. Dec 2015, 12:48
by socratis
Caesar wrote:If i press host+D and to capture VM screen
Unless you changed the defaults, that should be Host+E.
Caesar wrote:if i press PrtScn hotkey inside vm, it capture with a white screen
So, what's wrong with pressing the Host key combination? Do you need to look at the image inside your guest? From the looks of it, the game is using hardware acceleration (DirectX? OpenGL?) and that's where the problem might be. Do you have 2D and 3D enabled or disabled in the VM settings?

Re: Printscreen bug

Posted: 31. Dec 2015, 19:18
by Caesar
Yes the game is running in opengl!

I have 2d and 3d enabled in VM
a.png
a.png (78.77 KiB) Viewed 2400 times

Re: Printscreen bug

Posted: 31. Dec 2015, 19:51
by socratis
Unfortunately you answered only half of the questions:
socratis wrote:So, what's wrong with pressing the Host key combination? Do you need to look at the image inside your guest?

Re: Printscreen bug

Posted: 31. Dec 2015, 19:53
by Caesar
Yes i do, i need analyze the image inside the virtual machine, but each time i try print the game screen, it save the area all white.

Re: Printscreen bug

Posted: 31. Dec 2015, 20:09
by Caesar
I am developing a Delphi software to print screen the game screen and analyze the pixels.
Outside the VM it works, but inside the VM the print screen of the game becomes white.

Re: Printscreen bug

Posted: 31. Dec 2015, 20:34
by loukingjr
You could try disabling 3D acceleration for the guest if it's not required for the game to run.

Re: Printscreen bug

Posted: 31. Dec 2015, 20:55
by Caesar
I disabled 3d acceleration and it worked, now it print the screen correctly, but my fps in game is 2-3 i even cant move

Re: Printscreen bug

Posted: 1. Jan 2016, 00:15
by loukingjr
Unfortunately the problem is how 3D acceleration is handled in VirtualBox. You can have one thing but not the other. It's either or.

Re: Printscreen bug

Posted: 1. Jan 2016, 13:14
by mpack
This is perfectly normal. The whole point of hardware assisted graphics rendering is that the rendering is done in the graphics card, not in the PC. Obviously if the data is not in the VM then screengrabbing the VM using PrtScr will do nothing useful.

And please don't bandy words like "bug" around when you don't understand what it means. It can be really quite irritating. Failure to do what you expect is not per se a bug, at least not unless the person with the expectations is an expert in software design.

Re: Printscreen bug

Posted: 1. Jan 2016, 14:03
by loukingjr
I agree Don. It is perfectly normal in… VirtualBox

Re: Printscreen bug

Posted: 1. Jan 2016, 14:57
by mpack
It is perfectly normal period. A PC can't display data that isn't in the PC - it would have to fetch it from wherever it is really stored. In some cases that isn't possible, e.g. when the guest OS doesn't know that it needs to do something special.

The same applies to 2D video overlays. The PC just reserves a blue screen matting rectangle, the graphics card renders the video. If the PC does a screen grab all it will get is a black or blue rectangle.

If the rendering is done in the PC you can grab it, but of course PC rendering is much slower - otherwise they wouldn't have needed hardware acceleration.

Re: Printscreen bug

Posted: 2. Jan 2016, 17:01
by loukingjr
Well, I said what I had to say. I sent screenshots to demo what I meant and had no reply. On to other things.

Re: Printscreen bug

Posted: 2. Jan 2016, 17:25
by mpack
Yes, I saw the screenshots you sent me, I just wasn't quite sure what they were intended to prove. I didn't say that reading back from VRAM was impossible under any circumstances. I thought my first paragraph above was relatively clear about that.

My point basically is that (real) VRAM is in a separate address space and can't be captured by reading any part of a PC's RAM. To give an illusion otherwise the guest graphics driver would have to interpret the request and read back data from the graphics card, and that isn't always possible. E.g. I'm not sure that OpenGL has such a function at all (I may just have missed it, or be using the wrong OpenGL version), and I don't know what would happen if you captured a window instead of the current screen... in that case neither the PC nor the graphics card has fully composited graphics.

Re: Printscreen bug

Posted: 2. Jan 2016, 17:29
by loukingjr
I know Don. I just wanted to show my statement I made about how VirtualBox handles 3D acceleration wasn't completely out of left field.
Another screen shot… taken using PrtScr inside a VM.
Image

Edit: FWIW, I used the On Screen Keyboard for PrtScr so I wouldn't have to remap a key. :)