예제 #1
0
        public virtual void Draw(Graphics g)
        {
            Matrix matrix = new Matrix(1, 0, 0, 1, 0, 0);

            if (Rotation > 0)
            {
                matrix = ApplyRotation(matrix);
            }

            if (Skew != PointF.Empty)
            {
                matrix = ApplySkew(matrix);
            }

            g.Transform = matrix;

            g.DrawRectangle(new Pen(Color.FromArgb(LineAlpha, LineColor.ToColor()), LineThickness), X, Y, Width, Height);
            g.FillRectangle(new SolidBrush(Color.FromArgb(FillAlpha, FillColor.ToColor())), X + LineThickness - (LineThickness / 2), Y + LineThickness - (LineThickness / 2), Width - LineThickness, Height - LineThickness);

            g.ResetTransform();
        }