Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off the anti-aliasing in WPF shapes?

I draw a rectangle using:

<Rectangle Width="300" Height="100" Stroke="Blue" StrokeThickness="6"> </Rectangle>

but there is anti-aliasing applied to it. Is there a way to turn this off? I want it to be sharp and clear.

like image 278
Joan Venge Avatar asked Apr 07 '11 17:04

Joan Venge


1 Answers

A little late but RenderOptions.EdgeMode="Aliased" does the trick

<Rectangle Width="300"
           Height="100"
           Stroke="Blue"
           StrokeThickness="6"
           RenderOptions.EdgeMode="Aliased"/>
like image 160
Fredrik Hedblad Avatar answered Oct 10 '22 18:10

Fredrik Hedblad