Skip to content


1px line issue in silverlight

You might have noticed an issue when creating a line with 1px stroke thickness, when rendering the stroke thickness is more than 1px which is not we are expecting.

Image

Output of this looks like below

Image

Actually this is happening because, the rendering algorithm used inside.

 

So what we need to do to fix this issue……???

Fix: Very simple, add a translate transformation of 0.5 for both X and Y axis.

Image

 

Now if you run, u will get a correct 1px line.

Image

Posted in Siliverlight.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.