GetUnsignedRectangle() публичный Метод

public GetUnsignedRectangle ( ) : Rectangle
Результат System.Drawing.Rectangle
Пример #1
0
        protected internal override void Draw(Graphics g)
        {
            IsInvalidated = false;

            Rectangle r = BaseElement.GetUnsignedRectangle(new Rectangle(location, size));

            if (base.Backgroup != null)
            {
                g.DrawImage(base.Backgroup, r.X, r.Y, r.Width, r.Height);
            }
            Point[] points = new Point[5];
            points[0] = new Point(r.X + 0, r.Y + 0);
            points[1] = new Point(r.X + 0, r.Y + r.Height);
            points[2] = new Point(r.X + r.Width, r.Y + r.Height);

            //Fold
            points[3] = new Point(r.X + r.Width, r.Y + foldSize.Height);
            points[4] = new Point(r.X + r.Width - foldSize.Width, r.Y + 0);

            //foreach(Point p in points) p.Offset(location.X, location.Y);

            g.FillPolygon(GetBrush(r), points, FillMode.Alternate);
            g.DrawPolygon(new Pen(borderColor, borderWidth), points);

            g.DrawLine(new Pen(borderColor, borderWidth),
                       new Point(r.X + r.Width - foldSize.Width, r.Y + foldSize.Height),
                       new Point(r.X + r.Width, r.Y + foldSize.Height));

            g.DrawLine(new Pen(borderColor, borderWidth),
                       new Point(r.X + r.Width - foldSize.Width, r.Y + 0),
                       new Point(r.X + r.Width - foldSize.Width, r.Y + 0 + foldSize.Height));
        }
Пример #2
0
 void IResizeController.End(Point posEnd)
 {
     if ((el.Size.Height < 0) || (el.Size.Width < 0))
     {
         Rectangle urec = el.GetUnsignedRectangle();
         el.Location = urec.Location;
         el.Size     = urec.Size;
     }
     selCorner  = CornerPosition.Nothing;
     dragOffset = Point.Empty;
 }
Пример #3
0
        private bool NeedDrawElement(BaseElement el, Rectangle clippingRegion)
        {
            if (!el.Visible)
            {
                return(false);
            }

            Rectangle elRectangle = el.GetUnsignedRectangle();

            elRectangle.Inflate(5, 5);
            return(clippingRegion.IntersectsWith(elRectangle));
        }
Пример #4
0
        public override void DrawSelection(System.Drawing.Graphics g)
        {
            Color selColor = Color.Red;
            int   border   = 3;

            Rectangle r = BaseElement.GetUnsignedRectangle(
                new Rectangle(
                    el.Location.X - border, el.Location.Y - border,
                    el.Size.Width + (border * 2), el.Size.Height + (border * 2)));

            HatchBrush brush = new HatchBrush(HatchStyle.SmallCheckerBoard, Color.LightGray, Color.Transparent);
            Pen        p     = new Pen(brush, border);

            g.DrawEllipse(p, r);

            p.Dispose();
            brush.Dispose();
        }
        public override void DrawSelection(Graphics g)
        {
            int distance = 1;
            int border   = 2;

            Rectangle r = BaseElement.GetUnsignedRectangle(
                new Rectangle(
                    el.Location.X - distance, el.Location.Y - distance,
                    el.Size.Width + (distance * 2), el.Size.Height + (distance * 2)));

            //HatchBrush brush = new HatchBrush(HatchStyle.SmallCheckerBoard, Color.Red, Color.Transparent);
            SolidBrush brush = new SolidBrush(Color.FromArgb(150, Color.Green));
            Pen        p     = new Pen(brush, border);

            g.DrawRectangle(p, r);

            p.Dispose();
            brush.Dispose();
        }
Пример #6
0
        public virtual void DrawSelection(Graphics g)
        {
            int border = 3;

            Point elLocation = el.Location;
            Size  elSize     = el.Size;

            Rectangle r = BaseElement.GetUnsignedRectangle(
                new Rectangle(
                    elLocation.X - border, elLocation.Y - border,
                    elSize.Width + (border * 2), elSize.Height + (border * 2)));

            HatchBrush brush = new HatchBrush(HatchStyle.SmallCheckerBoard, Color.LightGray, Color.Transparent);
            Pen        p     = new Pen(brush, border);

            g.DrawRectangle(p, r);

            p.Dispose();
            brush.Dispose();
        }
Пример #7
0
		private bool NeedDrawElement(BaseElement el, Rectangle clippingRegion)
		{
			if (!el.Visible) return false;

			Rectangle elRectangle = el.GetUnsignedRectangle();
			elRectangle.Inflate(5, 5);
			return clippingRegion.IntersectsWith(elRectangle);
		}