Ejemplo n.º 1
0
            public LensVisual(LensInputMode inputMode)
            {
                this.inputMode = inputMode;
                var canvasControl = ((GraphControl)inputMode.InputModeContext.CanvasControl);

                lensGraphControl = new GraphControl
                {
                    Width  = inputMode.Size.Width,
                    Height = inputMode.Size.Height,

                    Graph      = canvasControl.Graph,
                    Selection  = canvasControl.Selection,
                    Projection = canvasControl.Projection,

                    Zoom = inputMode.ZoomFactor * canvasControl.Zoom,
                    HorizontalScrollBarPolicy = ScrollBarVisibility.Never,
                    VerticalScrollBarPolicy   = ScrollBarVisibility.Never,

                    // This is only necessary to show handles in the zoomed graph. Remove if not needed
                    InputMode = new GraphEditorInputMode(),
                };
                bitmap       = new Bitmap(inputMode.Size.Width, inputMode.Size.Height);
                clippingPath = new GraphicsPath();
                clippingPath.AddEllipse(new Rectangle(new Point(), inputMode.Size));
                region      = new Region(clippingPath);
                currentSize = inputMode.Size;
            }
Ejemplo n.º 2
0
 public LensVisualCreator(LensInputMode inputMode)
 {
     this.inputMode = inputMode;
 }