sYnced Posted May 2, 2012 at 08:58 PM Report #452816 Posted May 2, 2012 at 08:58 PM 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á!
petvetbr Posted May 2, 2012 at 09:26 PM Report #452821 Posted May 2, 2012 at 09:26 PM 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
sYnced Posted May 3, 2012 at 09:18 AM Author Report #452866 Posted May 3, 2012 at 09:18 AM Não estou a entender bem, quer dizer que este código que fiz até agora vai ter de ser apagado ?
petvetbr Posted May 3, 2012 at 02:01 PM Report #452895 Posted May 3, 2012 at 02:01 PM 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
sYnced Posted May 4, 2012 at 09:23 AM Author Report #453024 Posted May 4, 2012 at 09:23 AM 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).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now