DirectX游戏截图 [英] DirectX Game Screenshots

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

问题描述

软件:Visual Basic 2008
我的问题:
我编写了一个用于从游戏中截取屏幕截图的程序,这是我使用的当前代码:

Software: Visual Basic 2008
My problem:
I make a program for taking screenshots from the game, this is the current code that I use:

Dim bounds As Rectangle
            Dim screenshot As System.Drawing.Bitmap
            Dim graph As Graphics
            bounds = Screen.PrimaryScreen.Bounds
            screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
            graph = Graphics.FromImage(screenshot)
            graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
            PictureBox1.Image = screenshot



当我需要拍摄桌面截图时,它的效果很好,但是当我尝试拍摄游戏截图时,效果不佳!我在互联网上阅读,上面写着我需要从DirectX截屏.问题是我从来没有使用过DirectX,我需要您的帮助,如果与我的问题有关,欢迎您提供任何帮助,如果您有一些示例,我将不胜感激.





谢谢!



and it works great when i need to take a desktop screenshot, but when i try take a game screenshot it does not work! I read on the internet and it says that I need to take screenshots from DirectX. The problem is that I never worked with DirectX and I need your help, any help is welcome if it is related to my problem, I would appreciate if you have some kind of example.





Thank you!

推荐答案

这是在DirectX 9、10和11的C#中完成的方法:
http://spazzarama.wordpress.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/ [ ^ ]

这里的文章也有一个vb.net示例:
使用DirectX和.NET捕获示例 [
This is how it is done in c# for directx 9, 10 and 11:
http://spazzarama.wordpress.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/[^]

Here an article that also has a vb.net example:
Capture Sample with DirectX and .NET[^]

Good luck!


这篇关于DirectX游戏截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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