-
November 24th, 2018, 04:04 PM
#1
Taking a screen shot of a game (Counter-Strike 1.6)
Hello guys. I am trying to take a screen shot while I am ingame (counter-strike). When I try to take a screenshot it gives me a black picture. It happens only when I am in-game (when I am in desktop and take a screenshot, it works). Someone told me that this game uses OpenGL and maybe that is the problem. This is the code I use:
Code:
private Image CaptureScreen()
{
Rectangle screenSize = Screen.PrimaryScreen.Bounds;
Bitmap target = new Bitmap(screenSize.Width, screenSize.Height);
using (Graphics g = Graphics.FromImage(target))
{
g.CopyFromScreen(0, 0, 0, 0, new Size(screenSize.Width, screenSize.Height));
}
return target;
}
thanks in advance.
-
November 24th, 2018, 06:18 PM
#2
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Search bing or google for "taking a screenshot of open gl".
-
November 25th, 2018, 03:51 AM
#3
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Thanks. I already searched and found many articles but none of them worked, it givea me a black screen with white empty square on the left corner of the screen shot image.
-
November 25th, 2018, 09:56 AM
#4
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Maybe counterstrike is hooking the open gl call and preventing you from taking the screen shot?
-
November 25th, 2018, 10:37 AM
#5
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Yes that makes sense. I found an article says that the only way to do it is to use the injection method. Can you help me find something about it? I have searched and nothing comes up
-
November 25th, 2018, 03:51 PM
#6
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Originally Posted by Ornakash
Yes that makes sense. I found an article says that the only way to do it is to use the injection method. Can you help me find something about it? I have searched and nothing comes up
My point is that the game is hooking to prevent you from screen capturing. It is unlikely you'll be able to undo what they are doing with your own hook. Try searching bing or google for "how to hook a process." There's lots of info out there.
-
November 25th, 2018, 04:38 PM
#7
Re: Taking a screen shot of a game (Counter-Strike 1.6)
-
November 25th, 2018, 06:38 PM
#8
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Originally Posted by Arjay
My point is that the game is hooking to prevent you from screen capturing. It is unlikely you'll be able to undo what they are doing with your own hook. Try searching bing or google for "how to hook a process." There's lots of info out there.
I couldn't find a way to do this using C#. Some people say that it's not possible to hook a process in C#. Is it the only way to do it? I know C# better than CPP.
Source: https://support.microsoft.com/he-il/...n-visual-c-net
Last edited by Ornakash; November 25th, 2018 at 06:40 PM.
-
November 26th, 2018, 12:42 AM
#9
Re: Taking a screen shot of a game (Counter-Strike 1.6)
Originally Posted by Ornakash
The article you are linking to shows you how to hook a process in c#. Not sure why you are questioning whether it can be done when you have an article that shows you how to do it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|