internal static BitmapSource Capture(FrameworkElement element, Size maxSize) { double scale; Rect scaledRectangle = FrameworkElementCapturer.GetScaledRectangle(element, maxSize, out scale); element.LayoutTransform = (Transform) new ScaleTransform(scale, scale); element.Measure(scaledRectangle.Size); element.Arrange(scaledRectangle); return(VisualCapturer.Capture((Visual)element, new Size(scaledRectangle.Width, scaledRectangle.Height))); }
public override BitmapSource Capture() { if (this.element == null) { return((BitmapSource)null); } double scale; FrameworkElementCapturer.GetScaledRectangle(this.element, this.DefaultSize, out scale); this.Scale = scale; return(FrameworkElementCapturer.Capture(this.element, this.DefaultSize)); }
public static BitmapSource CaptureElement(FrameworkElement frameworkElement, Size maxSize) { return(FrameworkElementCapturer.Capture(frameworkElement, maxSize)); }