PurplePen.RegMarkCourseObj.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)
        {
            SymPath path1, path2;
            float thickness;

            GDIPlus_GraphicsTarget grTarget = new GDIPlus_GraphicsTarget(g);

            object brushKey = new object();
            grTarget.CreateGdiPlusBrush(brushKey, brush, false);

            // Get line thickness.
            thickness = TransformDistance(lineThickness * scaleRatio * appearance.lineWidth, xformWorldToPixel);

            // Get the paths.
            path1 = new SymPath(OffsetCoords(ScaleCoords((PointF[]) coords1.Clone()), location.X, location.Y), kinds1);
            path2 = new SymPath(OffsetCoords(ScaleCoords((PointF[]) coords2.Clone()), location.X, location.Y), kinds2);

            object penKey = new object();
            grTarget.CreatePen(penKey, brushKey, thickness, LineCap.Flat, LineJoin.Miter, 5);

            // Draw the paths
            path1.DrawTransformed(grTarget, penKey, xformWorldToPixel);
            path2.DrawTransformed(grTarget, penKey, xformWorldToPixel);

            grTarget.Dispose();
        }