public override void Highlight(Graphics g, Matrix xformWorldToPixel, Brush brush, bool erasing)
{
GDIPlus_GraphicsTarget grTarget = new GDIPlus_GraphicsTarget(g);
object brushKey = new object();
grTarget.CreateGdiPlusBrush(brushKey, brush, false);
// Get thickness of line.
float pixelThickness = TransformDistance(thickness * scaleRatio, xformWorldToPixel);
SymPath[] gappedPaths = LegGap.SplitPathWithGaps(path, gaps);
// Draw it.
object penKey = new object();
grTarget.CreatePen(penKey, brushKey, pixelThickness, LineCap.Flat, LineJoin.Miter, 5);
try {
foreach (SymPath p in gappedPaths) {
p.DrawTransformed(grTarget, penKey, xformWorldToPixel);
}
}
catch (ExternalException) {
// Ignore this exeption. Not sure what causes it.
}
grTarget.Dispose();
}