Exemple #1
0
        public async Task <BitmapSource> CreateScreenshot()
        {
            ScreenshotHelper.Parameters parameters = (this is Plotter2D) ? ((Plotter2D)this).Viewport.ScreenshotParameters : new ScreenshotHelper.Parameters();
            // turn off hit testing so any cursor graphics are removed
            IsHitTestVisible = false;
            var bitmap = await ScreenshotHelper.CreateScreenshot(this, parameters);

            IsHitTestVisible = true;
            return(bitmap);
        }
        public BitmapSource CreateScreenshot()
        {
            Window window = Window.GetWindow(this);

            Rect renderBounds = new Rect(RenderSize);

            Point p1 = TranslatePoint(renderBounds.Location, window);
            Point p2 = TranslatePoint(renderBounds.BottomRight, window);

            Int32Rect rect = new Rect(p1, p2).ToInt32Rect();

            rect.Y = 0;

            return(ScreenshotHelper.CreateScreenshot(this, rect));
        }
Exemple #3
0
        public BitmapSource CreateScreenshot()
        {
            UIElement parent = (UIElement)Parent;

            Rect renderBounds = new Rect(RenderSize);

            Point p1 = renderBounds.TopLeft;
            Point p2 = renderBounds.BottomRight;

            if (parent != null)
            {
                //p1 = TranslatePoint(p1, parent);
                //p2 = TranslatePoint(p2, parent);
            }

            Int32Rect rect = new Rect(p1, p2).ToInt32Rect();

            return(ScreenshotHelper.CreateScreenshot(this, rect));
        }
        public BitmapSource CreateScreenshot()
        {
            //<function summary>
            // Creates a screenshot using the ScreenshotHelper
            // A rectangle is calculated above the entire plot region
            // and given to the ScreenshotHelper in order to create a screenshot
            //</function summary>
            UIElement parent = (UIElement)Parent;

            Rect renderBounds = new Rect(RenderSize);

            Point p1 = renderBounds.TopLeft;
            Point p2 = renderBounds.BottomRight;

            if (parent != null)
            {
                p1 = TranslatePoint(p1, parent);
                p2 = TranslatePoint(p2, parent);
            }

            Int32Rect rect = new Rect(p1, p2).ToInt32Rect();

            return(ScreenshotHelper.CreateScreenshot(this, rect));
        }