Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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

Posted

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...

Created by: X

createdbyx@gmail.com

www.createdbyx.com

Posted

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

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*
Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...