PurplePen.CourseObj.DrawHighlight C# (CSharp) Method

DrawHighlight() public method

public DrawHighlight ( Graphics g, Matrix xformWorldToPixel ) : void
g System.Drawing.Graphics
xformWorldToPixel Matrix
return void
        public void DrawHighlight(Graphics g, Matrix xformWorldToPixel)
        {
            if (highlightBrush == null) {
                // Using a SolidBrush causes slight differences in drawing single pixel
                // wide lines. This must be due to some optimizations in GDI+. So we fake it by using
                // a single pixel texture brush.
                Bitmap bm = new Bitmap(1, 1);
                bm.SetPixel(0, 0, NormalCourseAppearance.highlightColor);
                highlightBrush = new TextureBrush(bm);
            }
            Highlight(g, xformWorldToPixel, highlightBrush, false);

            // Draw any handles we have.
            PointF[] handles = GetHandles();
            if (handles != null) {
                foreach (PointF handleLocation in handles)
                    DrawHandle(handleLocation, g, xformWorldToPixel);
            }
        }