开发者

Silverlight Path is blurry - How to snap to pixels?

I have a Canvas onto which I draw a Path:

<Path Data="M 380 110 v -10 l 100 -100"
      Stroke="#C0C0C2" StrokeThickness="1" UseLayoutRounding="True" />

Even though the StrokeThickness is set to 1, the vertical part of the path is drawn across 2 pixels and in a lighter color.

Silverlight Path is blurry - How to snap to pixels?

I know that WPF has the SnapsToDevicePixels property that would fix it, and I read that in Silverlight there开发者_JAVA百科 is a UseLayoutRounding property that you can use in some cases to have the same effect, however it does not seem to apply to Path.

Is there anything I can do to get that line drawn properly?


There is a pixel snapper class over at MSDN on Dave Relyea's Silverlight Blog. That is what I have used in the past for Silverlight pixel snapping.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜