0 Replies - 221 Views - Last Post: 16 December 2013 - 06:15 AM Rate Topic: -----

#1 ivanov_o  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 16-January 13

Need help with Direct3D Surface.ToFile

Posted 16 December 2013 - 06:15 AM

Hi,
I have a little problem with rendering to a surface. I want my 3D rendered model to be exported as surface or birmap, well by now I've almost made it to render to a surface with one little exception - the output image is very noisy and distorted, I've attached it with the topic.

here is my code:

 Private RtsHelper As RenderToSurface
        Private RenderTexture As Texture
        Private RenderSurface As Surface

        Public Sub GetBitmap()
            RtsHelper = New RenderToSurface(D3Device, MyBase.window.Width, MyBase.window.Height, _
                                             Format.X8R8G8B8, Format.D16)
            RenderTexture = New Texture(D3Device, MyBase.window.Width, MyBase.window.Height, 1,
                                        Usage.RenderTarget, Format.X8R8G8B8, Pool.Default)

            RenderSurface = RenderTexture.GetSurfaceLevel(0)
            
            Surface.ToFile(RenderSurface, "stf.bmp", ImageFileFormat.Bmp)
        End Sub



Can you tell me where I do things wrong, thank you!

Attached File(s)

  • Attached File  stf.bmp (182.87K)
    Number of downloads: 12


Is This A Good Question/Topic? 0
  • +

Page 1 of 1