Jump to content

Recommended Posts

Posted
int num = name.Next(10);
                int nom = name.Next(100);
                int nem = name.Next(1000);
                string[] abc = new string[] { "a", "A", "b", "B", "c", "C" };
                string nume = abc[name.Next(abc.Length)];
                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));
                string nomeprint = txtUsername.Text + "_" + nume + num.ToString() + nom.ToString() + nem.ToString();
                bmpScreenShot.Save(nomeprint + ".jpg", ImageFormat.Jpeg);

Bem pessoal este é um código que estou a usar para tirar screenshot's a um jogo (mais propriamente counter strike 1.6) mas os screens ficam pretos, alguém me pode ajudar ?

Obrigado desde já!

Posted

Este esquema que você colocou só funciona para telas GDI (convencionais), para telas renderizadas por DirectX, é necessário usar um esquema diferente e bem mais complicado. eu achei alguns exemplos aqui:

http://spazzarama.com//2010/03/29/screen-capture-with-direct3d-api-hooks/

http://spazzarama.com/2009/02/07/screencapture-with-direct3d/

http://stackoverflow.com/questions/1962142/take-screenshot-of-directx-full-screen-application

Fernando Lage Bastos - MCP/MCTS/MCPD

Posted

Isto mesmo, este código que você fez até agora não irá funcionar para o CounterStrike ou outros jogos que utilizem DirectX, somente para aplicativos convencionais.

Fernando Lage Bastos - MCP/MCTS/MCPD

Posted

Mas eu não estou a entender muito bem como vou usar, visto que copiei o código e tentei usar e não me reconhecia certas coisas (acho que não tinha nada a haver com variáveis).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.