Sign in to follow this  

High resolution Screen shot

This topic is 4716 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
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

This topic is 4716 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.

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

Sign in to follow this