Bcfier.XbimXplorer.AddViewXbim.Get3DVisual C# (CSharp) Метод

Get3DVisual() приватный статический Метод

private static Get3DVisual ( FrameworkElement element ) : System.Windows.Media.Imaging.RenderTargetBitmap
element System.Windows.FrameworkElement
Результат System.Windows.Media.Imaging.RenderTargetBitmap
        private static RenderTargetBitmap Get3DVisual(FrameworkElement element)
        {
            var width = element.ActualWidth;

            var height = element.ActualHeight;
            var bmpCopied = new RenderTargetBitmap((int) Math.Round(width), (int) Math.Round(height), 96, 96,
                PixelFormats.Default);
            var dv = new DrawingVisual();
            using (var dc = dv.RenderOpen())
            {
                var vb = new VisualBrush(element);
                dc.DrawRectangle(vb, null, new Rect(new System.Windows.Point(), new Size(width, height)));
            }
            bmpCopied.Render(dv);
            return bmpCopied;
        }