示例#1
0
        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)));
        }
示例#2
0
        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));
        }
示例#3
0
 public static BitmapSource CaptureElement(FrameworkElement frameworkElement, Size maxSize)
 {
     return(FrameworkElementCapturer.Capture(frameworkElement, maxSize));
 }