ThePentiumGuy Posted March 10, 2004 Posted March 10, 2004 hey guys, how would i take a screenshot(printscreen) of my d3d app? if i try to do it, i end up getting a big green square.. which is supposedly my world.. any help would be appreciated, thanks pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
createdbyx Posted March 10, 2004 Posted March 10, 2004 If I remember correctly (doing this from memory) you can just call 3D3Device.Getbackbuffer to get access your back buffer surface Then Call Direct3D.SurfaceLoader.Save to save the surface that is returned from the 3D3Device.Getbackbuffer method. Hope that Helps. NOTE: Make sure you don't do a D3DDevice.clear before you save or u will save an empty image... Quote Created by: X createdbyx@gmail.com www.createdbyx.com
*Experts* mutant Posted March 10, 2004 *Experts* Posted March 10, 2004 I wrote an example and uploaded it to my website yesterday. Its a little different then using the backbuffer (like createdbyx said) but similar: http://www.directx4.net/modules.php?name=Content&pa=showpage&pid=26 Quote
ThePentiumGuy Posted March 10, 2004 Author Posted March 10, 2004 thanks both of you, ill try both ways of doing this :-) Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
ThePentiumGuy Posted March 12, 2004 Author Posted March 12, 2004 i got it to work, a friend of mine (darc, from this forum) sent me his function, and it seems to work pretty well PrivateFunction GetScreenCapture(ByVal FileName AsString, OptionalByVal FullScreen AsBoolean = False) As Image ' Captures the current screen and returns as an Image ' object Dim objSK As SendKeys Dim imgCapture As Image If FullScreen = TrueThen ' Print Screen pressed twice here as some systems ' grab active window "accidentally" on first run objSK.SendWait("{PRTSC 2}") Else objSK.SendWait("%{PRTSC}") EndIf Dim objData As IDataObject = Clipboard.GetDataObject() ReturnCType(objData.GetData(DataFormats.Bitmap), Bitmap) EndFunction heh i have no idea how it works :), thanks for your help guys, sorry, i couldnt get it to work tho Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
*Experts* mutant Posted March 13, 2004 *Experts* Posted March 13, 2004 I would call that the worst method you can use because DirectX provides functionality to take screenshots. What didn't work for you while using D3D to take the screenshot? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.