Esempio n. 1
0
        private void DrawResizer(Graphics graphics)
        {
            GraphicsPath path;

            if (direction == PKResizeDirection.TopBottom)
            {
                path = PKRoundedRectangle.Create(resizeRect, SIZE,
                                                 PKRectangleCorners.TopLeft | PKRectangleCorners.TopRight);
            }
            else
            {
                path = PKRoundedRectangle.Create(resizeRect, SIZE,
                                                 PKRectangleCorners.TopLeft | PKRectangleCorners.BottomLeft);
            }

            using (Brush brush = new LinearGradientBrush(resizeRect, Color.White,
                                                         MouseHit?Color.Yellow:Color.LightYellow,
                                                         direction == PKResizeDirection.TopBottom?90:0))
            {
                graphics.FillPath(brush, path);
                graphics.DrawPath(Pens.Black, path);
            }

            Rectangle rect = resizeRect;

            rect.Inflate(-4, -4);
            graphics.DrawRectangle(Pens.Black, rect);
        }
Esempio n. 2
0
        private void DrawSizeInfoBackground(Graphics graphics, Rectangle rect)
        {
            var x = PKRoundedRectangle.Create(rect, (int)(rect.Height / 2),
                                              PKRectangleCorners.None);

            using (Brush brush = new LinearGradientBrush(rect, Color.White, Color.Yellow,
                                                         LinearGradientMode.Vertical))
            {
                graphics.FillPath(brush, x);
                graphics.DrawPath(Pens.Black, x);
            }
        }