![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| Guest | Issues using RenderTargetBitmap with a Viewport3D I am attempting to save out an image of a Viewport3D using RenderTargetBitmap but the image is not matching what I'm seeing in the Viewport3D. The code is straightforward enough... // Begin code int width = (int)myViewport3D.RenderSize.Width; int height = (int)myViewport3D.RenderSize.Height; RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32); bmp.Render(myViewport3D); JpegBitmapEncoder jpgEncoder = new JpegBitmapEncoder(); jpgEncoder.QualityLevel = 100; jpgEncoder.Frames.Add(BitmapFrame.Create(bmp)); using (Stream stream = File.Create(@"C:\temp\output.jpg")) { jpgEncoder.Save(stream); } // End code The jpg gets created, it's the right size and has some of the contents in my viewport displayed in it, but not all. Some of the ModelVisual3D's are not displayed, some are only partially displayed and some look great. It definitely does not match what I see on the screen at the time the snapshot is taken. Has anyone seen this behavior before? Any thoughts/suggestions/questions? Tom. |
My System Specs![]() |