Exemplo n.º 1
0
        /// <summary>
        /// Handles the InkOverlay to ensure that displayed strokes have not been resized.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event</param>
        /// <param name="e">Selection resizing event</param>
        private void sketchInk_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
        {
            // Move to back to original spot
            this.inkPic.Selection.ScaleToRectangle(e.OldSelectionBoundingRect);

            // Trick to insure that selection handles are updated
            this.inkPic.Selection = this.inkPic.Selection;

            // Reset our resizing flag
            this.selectionResizing = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Resizes InkPicture when necessary (for scrolling) and notifies subscribers
        /// </summary>
        protected void inkPic_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
        {
            Rectangle oldBB = e.OldSelectionBoundingRect;
            Rectangle newBB = inkPic.Selection.GetBoundingBox();

            InkTransformedEventHandler xformEvent = InkTransformed;

            if (xformEvent != null)
            {
                xformEvent(oldBB, newBB, inkPic.Selection, InkTransformEventType.SelectionToolTransform);
            }

            this.resizeInkPicture();

            updateFocus();
        }
Exemplo n.º 3
0
        private void inkOverlay_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
        {
            if (this.InvokeRequired)
            {
                return;
            }

            Nodes selectedNodes = graph.Nodes.getNodes(inkOverlay.Selection);

            for (int i = 0; i < selectedNodes.Length(); i++)
            {
                Rectangle r = selectedNodes[i].Stroke.GetBoundingBox();
                selectedNodes[i].CenterPoint = new Point(r.X + r.Width / 2, r.Y + r.Height / 2);
            }
            Invalidate();
        }
Exemplo n.º 4
0
        private void inkOverlay_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
        {
            if(this.InvokeRequired) return;

            Nodes selectedNodes = graph.Nodes.getNodes(inkOverlay.Selection);
            for(int i=0; i<selectedNodes.Length(); i++)
            {
                Rectangle r = selectedNodes[i].Stroke.GetBoundingBox();
                selectedNodes[i].CenterPoint = new Point(r.X+r.Width/2, r.Y+r.Height/2);
            }
            Invalidate();
        }
Exemplo n.º 5
0
 private void inkoverlay_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
 {
     // Share impl with move.
     inkoverlay_SelectionMovedOrResized(sender, e.OldSelectionBoundingRect);
 }
Exemplo n.º 6
0
 private void inkoverlay_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
 {
     // Share impl with move.
     inkoverlay_SelectionMovedOrResized(sender,e.OldSelectionBoundingRect);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Resizes InkPicture when necessary (for scrolling)
        /// </summary>
        protected void inkPic_SelectionResized(object sender, InkOverlaySelectionResizedEventArgs e)
        {
            this.resizeInkPicture();

            updateFocus();
        }