DisplayRegionEditInProgress() public method

public DisplayRegionEditInProgress ( Microsoft.Graphics.Canvas.CanvasDrawingSession drawingSession, List points, float zoomFactor ) : void
drawingSession Microsoft.Graphics.Canvas.CanvasDrawingSession
points List
zoomFactor float
return void
示例#1
0
        void Canvas_Draw(CanvasControl sender, CanvasDrawEventArgs args)
        {
            if (photo.SourceBitmap == null)
            {
                return;
            }

            var drawingSession = args.DrawingSession;

            drawingSession.Units = CanvasUnits.Pixels;
            drawingSession.Blend = CanvasBlend.Copy;

            // Draw the main photo image.
            ICanvasImage image;

            if (editingRegion != null)
            {
                image = cachedImage.Get() ?? cachedImage.Cache(photo, photo.GetImage());
            }
            else
            {
                image = photo.GetImage();
            }

            drawingSession.DrawImage(image);

            // Highlight the current region (if any).
            lastDrawnZoomFactor = null;

            foreach (var edit in photo.Edits)
            {
                if (edit.DisplayRegionMask(drawingSession, scrollView.ZoomFactor, editingRegion != null))
                {
                    lastDrawnZoomFactor = scrollView.ZoomFactor;
                }
            }

            // Display any in-progress region edits.
            if (editingRegion != null)
            {
                editingRegion.DisplayRegionEditInProgress(drawingSession, regionPoints, scrollView.ZoomFactor);
            }
        }