Jump to content
  • Advertisement
Sign in to follow this  
de_matt

High resolution Screen shot

This topic is 5020 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hya, I've written an editor for creating textures. I've used Visual Basic 6 and I'm using a picture box for the rendering. The picture boxes scalemode is Pixel. Now I want to save out the resulting scene at high resolution (1600 * 1200 for example). How do I do this? Do I need to create a surface of this size and render to that surface? If this is the case could someone please provide me with some code (in Visual Basic if possible) because my attempt at this didn't work. Here's what I tried : <code> 'get the old render target Dim OldRenderTarget As Direct3DSurface8 Set OldRenderTarget = pD3DDEVICE.GetRenderTarget() 'get the current depth stencil Dim OldDepthStencil As Direct3DSurface8 Set OldDepthStencil = pD3DDEVICE.GetDepthStencilSurface() 'create a new render surface Dim RenderSurface As Direct3DSurface8 Set RenderSurface = pD3DDEVICE.CreateRenderTarget(ResX, ResY, D3DFMT_R8G8B8, D3DMULTISAMPLE_NONE, 0) 'create a new render target Dim NewRenderTarget As D3DXRenderToSurface Set NewRenderTarget = pD3DX.CreateRenderToSurface(pD3DDEVICE, ResX, ResY, D3DFMT_R8G8B8, True, D3DFMT_A4R4G4B4) 'get the viewport Dim CurrentViewPort As D3DVIEWPORT8 'start the scene NewRenderTarget.BeginScene RenderSurface, CurrentViewPort 'render the scene Render 'end the scene NewRenderTarget.EndScene 'reset the render targets 'pD3DDEVICE.SetRenderTarget OldRenderTarget, OldDepthStencil, 0 'save the texture 'pD3DX.SaveSurfaceToFile Filename, D3DXIFF_BMP, NewRenderTarget, ByVal 0, ByVal 0 </code> I'd be really greatfull for any help you could give me. Thanks Matt

Share this post


Link to post
Share on other sites
Advertisement
Jpeg compression is terrible, but PNG format works quite well for taking screenshots, its smaller than BMP and a lot higher quality than Jpeg (and about the same size)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!