PurplePen.StartCourseObj.Highlight C# (CSharp) Method

Highlight() public method

public Highlight ( Graphics g, Matrix xformWorldToPixel, Brush brush, bool erasing ) : void
g System.Drawing.Graphics
xformWorldToPixel Matrix
brush System.Drawing.Brush
erasing bool
return void
        public override void Highlight(Graphics g, Matrix xformWorldToPixel, Brush brush, bool erasing)
        {
            // Transform the thickness to pixel coords.
            float thickness = TransformDistance(NormalCourseAppearance.lineThickness * scaleRatio * appearance.lineWidth, xformWorldToPixel);

            // Get coordinates of the triangle and transform to pixel coords.
            PointF[] pts = OffsetCoords(ScaleCoords(RotateCoords((PointF[]) coords.Clone(), orientation)), location.X, location.Y);
            xformWorldToPixel.TransformPoints(pts);

            // Draw the triangle.
            using (Pen pen = new Pen(brush, thickness)) {
                g.DrawPolygon(pen, pts);
            }

            if (crossHairOptions == CrossHairOptions.HighlightCrossHair) {
                // Draw the cross-hair.
                HighlightCrossHair(g, xformWorldToPixel, brush);
            }
        }