GridPattern StrokeThichness


It appears that the lines in a GridPattern are always a minimum of 2 pixels thick. I’ve tried setting the thickness to 1 (in which case it’s drawn as 2 pixels) and 4 (in which case it’s drawn as 4 pixels, so I know my settings are being done correctly).

Even in the GoWpf demo app from Northwoods, in the Draggable Link sample, the StrokeThicknesses are set to 0.2 and 0.3, but they are drawn on the screen as 2 pixels.

Has anyone succeeded in making 1-pixel thick grid lines?


My guess is that you’re seeing the effects of anti-aliasing.

GoXam isn’t doing anything special – you really are just using the standard WPF Path element with its usual properties. The GridPattern doesn’t modify anything but the Path’s geometry (Data) and Visibility. Hmmm, in checking the code, it also modifies the StrokeDashCap, StrokeDashArray, and StrokeDashOffset, depending on the GridFigure. It only sets the StrokeThickness if the StrokeThickness was zero.