ThinkGeo.com    |     Documentation    |     Premium Support

Hatch Line Style

ThinkGeo v12.2
Is it possible to create a line style that uses a hatch brush? I am using the following style and the line is displayed as solid with a color of Teal:

var lineStyle = new LineStyle();
lineStyle.InnerPen = new GeoPen()
{
Brush = new GeoHatchBrush(GeoHatchStyle.DashedVertical, GeoColors.OrangeRed, GeoColors.Yellow),
Color = GeoColors.Teal,
Width = 15.0F,
StartCap = DrawingLineCap.Square,
EndCap = DrawingLineCap.Square
};

Hey @Rick_Heinz,

Unfortunately, only GeoSolidBrushes are supported at this time for LineStyles (or more specifically, GeoPens). This is primarily because they have no real area. GeoHatchBrushes should really only be used as a fill for polygon shapes. What you could do instead is use DashStyles on the GeoPen itself to let certain features stand out from others:

LineStyle lineStyle = new LineStyle(new GeoPen(GeoColors.Aqua, 8)
{
    DashStyle = LineDashStyle.Custom, 
    DashPattern = { 2, 1, 5, 1 }
});

Thanks,
Kyle

OK, thank you for the reply.

Hey @Rick_Heinz,

You’re welcome. Sorry that the hatch brush doesn’t work with line styles. Closing.

Thanks,
Kyle