我正在尝试捕获我的 WPF Viewport3D,问题是无论我做什么都不能以高质量捕获,RenderTargetBitmap 的参数应该是什么以获得最佳质量?
RenderTargetBitmap bmp = new RenderTargetBitmap(
(int)viewport3D.ActualWidth, (int)viewport3D.ActualHeight, 96, 96, PixelFormats.Pbgra32);
bmp.Render(viewport3D);
PngBitmapEncoder png = new PngBitmapEncoder();
png.Frames.Add(BitmapFrame.Create(bmp));
using (Stream stm = File.Create(m_captureWithoutMainModelFileName))
{
png.Save(stm);
}
我也尝试将图像另存为 BMP,但它并没有提高质量。