Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

After i render my X file i try to save the back buffer to a file, as seen below. But i recieve the following error

Error 5

Error in the application.

 

in directx 8.1 i had it working fine. does anyone know why this is not working, or if there are any issues with directx9 and surfaceloader?

 

thanks

 

 

'save backbuffer to image

Dim surf As Microsoft.DirectX.Direct3D.Surface

 

surf = g_D3DDevice.GetBackBuffer(0, 0, BackBufferType.Mono)

 

Dim destRect As System.Drawing.Rectangle

destRect.X = 0

destRect.Width = g_width

destRect.Y = 0

destRect.Height = g_height

 

'surf2 = g_D3DDevice.CreateOffscreenPlainSurface(1024, 1024, Mode.Format, Pool.Default)

'SurfaceLoader.FromSurface(surf2, surf, destRect, Filter.None, 0)

 

SurfaceLoader.Save("C:\test.bmp", ImageFileFormat.Bmp, surf)

  • 3 years later...

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