Silverlight Path is blurry - How to snap to pixels?

匿名 (未验证) 提交于 2019-12-03 01:48:02

问题:

I have a Canvas onto which I draw a Path:

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

I know that WPF has the SnapsToDevicePixels property that would fix it, and I read that in Silverlight there 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?

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!