空白屏幕截图在Vista和Win7游戏时 [英] Blank Screenshots In Vista and Win7 when gaming

查看:191
本文介绍了空白屏幕截图在Vista和Win7游戏时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到另外一个人还要求帮助这一点。我读了后,似乎它是尚未解决。我还试图从我的代码更改为代码邮报2点击屏幕快照,而是实现在我的代码由于某种原因,我的所有其他代码搞砸左右。



目前,该截屏在Win XP中完全显示出来。在Vista和Win7怎么过,他们出现空白,除非游戏在窗口模式下播放。我希望有人在那里可以帮助我们,因为这是最后一步来完成我们的计划,我们不能没有这个问题修复完成。



我使用了屏幕的C#代码镜头在下面。

 位图bmpScreenshot =新位图(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen。 Bounds.Height,
PixelFormat.Format32bppArgb);
图形gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
Screen.PrimaryScreen.Bounds.Y,
0,0,
Screen.PrimaryScreen.Bounds.Size,
CopyPixelOperation.SourceCopy);


解决方案

我猜您尝试使用采取截图硬件的正常屏幕缓冲区加速表面。您的Windows XP结果很可能是侥幸:独特的或非optimial视频配置(你可能会得到同样的结果,如果你尝试拍摄的视频截图 - 大黑,棕色或粉红色长方形,其中显卡插入加速帧缓冲)。



您将需要或者调低系统视频加速(这里的一切被渲染到软件屏幕缓冲区兼容性模式),这是一个系统范围的设置,或者改变你的截图代码直接与您正在使用(的DirectX,OpenGL的)图形API的工作 - 为代码是完全依赖于你正在使用的渲染API /法


I noticed another person also requested help on this. I read that post and it seems it wasn't resolved yet. I also tried changing from my code to the code in the "Screen shot in 2 clicks" Post, But implementing that in my code messed around with all my other code for some reason.

At the moment, The screen shots show up perfectly in Win XP. In Vista and Win7 how ever, they show up blank unless the game is played in window mode. I hope someone out there can help us as this is the last step to finishing our program and we cannot finish without this issue fixed.

The C# code I am using for screen shots is below.

Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
                                  Screen.PrimaryScreen.Bounds.Height,
                                  PixelFormat.Format32bppArgb);
Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
                             Screen.PrimaryScreen.Bounds.Y,
                             0, 0,
                             Screen.PrimaryScreen.Bounds.Size,
                             CopyPixelOperation.SourceCopy);

解决方案

I would guess you are trying to take a screenshot using the normal screen buffer of a hardware accelerated surface. Your Windows XP result is likely a fluke: a unique or non-optimial video configuration (You'll likely get the same results if you try taking a screenshot of a video - a big black, brown or pink rectangle where the video card inserts the accelerated frame buffer).

You would need to either turn down the systems video acceleration (compatiblity mode where everything gets rendered to the software screen buffer) which is a system wide setting, or change your screenshot code to work directly with the graphics API you are using (DirectX, OpenGL) - the code for that is entirely dependent on the API/method you are using for rendering.

这篇关于空白屏幕截图在Vista和Win7游戏时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆