예제 #1
0
        /// <summary>
        /// Draw a rectangle;
        /// </summary>
        /// <param name="brush">The brush to fill the rect</param>
        /// <param name="pen">The pen to decorate the border of the rect</param>
        /// <param name="rect"></param>
        public void DrawRectangle(CADRect rect, Brush brush, Pen pen)
        {
            ValidateDrawingContext();

            var topLeftInScreen = CADScreenConverter.ToScreen(rect.TopLeft);
            var widthInScreen   = CADScreenConverter.ToScreen(rect.Width);
            var heightInScreen  = CADScreenConverter.ToScreen(rect.Height);
            var rectInScreen    = new Rect(topLeftInScreen, new Size(widthInScreen, heightInScreen));

            DrawingContext.DrawRectangle(brush, pen, rectInScreen);
        }
 public DragSelectMouseMoveEventArgs(CADRect rect, Point position)
 {
     Rect     = rect;
     Position = position;
 }
예제 #3
0
 public DragSelectEventArgs(Point position, CADRect rect, DrawObject[] hitedDrawObjects)
 {
     Position         = position;
     Rect             = rect;
     HitedDrawObjects = hitedDrawObjects ?? throw new ArgumentNullException(nameof(hitedDrawObjects));
 }