Taking screenshots from DirectX Games
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hi I am trying to take screenshots from DirectX Games and I successfully take screenshots most of the time. But sometimes my screenshots come out completely black. Here is the code I am using to take screenshot:</b>
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);A global solution to take screenshots would be great (for desktop - for DirectX and OpenGL games). Thank you.