Exemplo n.º 1
0
        public static PPath CreateRectangle(float x, float y, float width, float height)
        {
            PPath rect = new PPath();

            SetPathToRectangle(rect, x, y, width, height);
            return(rect);
        }
Exemplo n.º 2
0
        public static PPath CreateLine(float x1, float y1, float x2, float y2)
        {
            PPath line = new PPath();

            line.AddPoint(new PointF(x1, y1));
            line.AddPoint(new PointF(x2, y2));
            return(line);
        }
Exemplo n.º 3
0
 private static void SetPathToRectangle(PPath path, float x, float y, float width, float height)
 {
     path.Reset();
     path.AddPoint(new PointF(x, y));
     path.AddPoint(new PointF(x + width, y));
     path.AddPoint(new PointF(x + width, y + height));
     path.AddPoint(new PointF(x, y + height));
     path.Closed = true;
 }
Exemplo n.º 4
0
            protected override void OnStartDrag(object sender, PInputEventArgs e)
            {
                base.OnStartDrag (sender, e);

                squiggle = new PPath();
                lastPoint = e.Position;
                //squiggle.Pen = new Pen(Brushes.Black, (float)(1/ e.Camera.ViewScale));
                layer.AddChild(squiggle);
            }
Exemplo n.º 5
0
 protected override void OnEndDrag(object sender, PInputEventArgs e)
 {
     base.OnEndDrag (sender, e);
     UpdateSquiggle(e);
     squiggle = null;
 }
Exemplo n.º 6
0
 private static void SetPathToRectangle(PPath path, float x, float y, float width, float height)
 {
     path.Reset();
     path.AddPoint(new PointF(x, y));
     path.AddPoint(new PointF(x+width, y));
     path.AddPoint(new PointF(x+width, y+height));
     path.AddPoint(new PointF(x, y+height));
     path.Closed = true;
 }
Exemplo n.º 7
0
 public static PPath CreateRectangle(float x, float y, float width, float height)
 {
     PPath rect = new PPath();
     SetPathToRectangle(rect, x, y, width, height);
     return rect;
 }
Exemplo n.º 8
0
 public static PPath CreateLine(float x1, float y1, float x2, float y2)
 {
     PPath line = new PPath();
     line.AddPoint(new PointF(x1, y1));
     line.AddPoint(new PointF(x2, y2));
     return line;
 }
        /// <summary>
        /// Sets some initial values for the marquee including it's brush and pen.
        /// </summary>
        /// <param name="e">A PInputEventArgs that contains the event data.</param>
        protected virtual void InitializeMarquee(PInputEventArgs e)
        {
            marquee = PPath.CreateRectangle(presspt.X, presspt.Y, 0, 0);
            marquee.Brush = marqueeBrush;
            marquee.Pen = pens[0];
            marqueeParent.AddChild(marquee);

            marqueeMap.Clear();
        }
 /// <summary>
 /// Ends a marquee selection sequence.
 /// </summary>
 /// <param name="e">A PInputEventArgs that contains the event data.</param>
 /// <remarks>
 /// <b>Notes to Inheritors:</b>  Subclasses can override this method to be notified
 /// at the end of a marquee selection sequence.
 /// <para>
 /// Overriding methods must still call <c>base.EndMarqueeSelection()</c> for correct
 /// behavior.
 /// </para>
 /// </remarks>
 protected virtual void EndMarqueeSelection(PInputEventArgs e)
 {
     // Remove marquee
     marquee.RemoveFromParent();
     marquee = null;
 }