PurplePen.RectCourseObj.DrawBorderedRectangle C# (CSharp) Method

DrawBorderedRectangle() protected static method

protected static DrawBorderedRectangle ( Graphics g, Matrix xformWorldToPixel, RectangleF rectToDraw, Brush brush, bool erasing ) : void
g System.Drawing.Graphics
xformWorldToPixel Matrix
rectToDraw System.Drawing.RectangleF
brush System.Drawing.Brush
erasing bool
return void
        protected static void DrawBorderedRectangle(Graphics g, Matrix xformWorldToPixel, RectangleF rectToDraw, Brush brush, bool erasing)
        {
            RectangleF xformedRect = Geometry.TransformRectangle(xformWorldToPixel, rectToDraw);

            // Get a brush to fill the interior with.
            Brush fillBrush;

            if (erasing)
                fillBrush = brush;
            else
                fillBrush = NormalCourseAppearance.areaHighlight;

            // Draw the interior
            g.FillRectangle(fillBrush, xformedRect);

            // Draw the boundary.
            using (Pen pen = new Pen(brush, 2)) {
                g.DrawRectangle(pen, xformedRect.Left, xformedRect.Top, xformedRect.Width, xformedRect.Height);
            }
        }