Tiling rectangles seamlessly in WPF while maintaing subpixel accuracy?

Posted by Jens on Stack Overflow See other posts from Stack Overflow or by Jens
Published on 2010-05-27T13:14:21Z Indexed on 2010/05/31 6:12 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

I have had the problem described in the question Tiling rectangles seamlessly in WPF, but am not really happy with the answers given there.

I am painting a bar chart by painting lots of rectangles right next to each other. Depending on the scale of the canvas containing them, there are small gaps visible between some of them as a result from sub-pixel rendering.

I learned from the above question how to make my rectangles fit with the screen pixels, removing that effect.

Unfortunately, my chart may display way more bars than there are pixels. Apart from the tiny gaps (which manifest as a periodic change in color saturation), this works well. If I snap each bar with the screen pixels, most of the bars vanish, though, so I am looking for another solution.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf