talked about SnapsToDevicePixels and there were some bits I neglected to mention.
Yes, SnapsToDevicePixels is inherited by the subordinate elements in the Visual Tree. For example. Here is a Border which contains a Rectangle. The border is positioned at 20.5, 20.5 again.
Here are the same elements with SnapsToDevicePixels set to True on the inner Rectangle.
... and again but this time with SnapsToDevicePixels set to true on the outer Border and not specified on the inner Rectangle.
Here's the Xaml used in the final example.
<Border Canvas.Top="20.5" Canvas.Left="20.5" Width="30" Height="30" BorderThickness="1" BorderBrush="Black" CornerRadius="10,0,10,0" SnapsToDevicePixels="True">
<Rectangle Width="10" Height="10" Stroke="Red" />
24 Jul 2007
» Next Post:
Tonight PowerShell saved my music library
« Previous Post:
Infinite Resolution and SnapsToDevicePixels
Comments are closed for this post.
03 Mar 2010
i had a problem probaly with SnapsToDevicePixels.
I want drawing a black line with 1 pixel thickness is OnRender Method.
But always it is 2 pixel width and color is gray. I cannot find any solution.
Can you help me?