Hello together,
I have a Problem using a VisualBrush Tile Background on a Canvas.
I want to draw horizontal and vertical helplines in black Color. But all the time, the lines are antialiased (the vertical is 1 pixel wide but gray and the horizontal line is 2px high and also gray / light gray). If I copy in the Lines to the Childrens of Canvas, it is displayed clear in real black color and only 1 pixel wide.
I have following Source Code.
<Canvas Width="800" Height="400" SnapsToDevicePixels="True"><Canvas.Background><VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute" Viewbox="0,0,20,20" ViewboxUnits="Absolute"><VisualBrush.Visual><Grid><Line X1="0" Y1="0" X2="0" Y2="20" Stroke="Black" StrokeThickness="1" /><Line X1="0" Y1="0" X2="20" Y2="0" Stroke="Black" StrokeThickness="1" /></Grid></VisualBrush.Visual></VisualBrush></Canvas.Background><Canvas.Children><Line X1="50" Y1="50" X2="80" Y2="50" Stroke="Black" StrokeThickness="1" /><Line X1="50" Y1="50" X2="50" Y2="80" Stroke="Black" StrokeThickness="1" /></Canvas.Children></Canvas>
We use .NET 4.0.
Can you please help me how to solve this problem to get really black and clear lines in Background?
Thank you.
Kind regards
Stefan