Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF DrawingContext seems ignore SnapToDevicePixels

I'm drawing a chart by direct calls to DrawLine on the DrawingContext. Since I want to avoid any anti aliasing feature, I tryed to put the SnapToDevicePixels=true on the parent UIElement, but I still have anti-alias:

enter image description here

The project was an old OS project not written for WPF4, but I retarget it to the Framework4, can this be an issue too ?

like image 516
Felice Pollano Avatar asked May 16 '11 13:05

Felice Pollano


1 Answers

I found this link where they basically say you should set

ParentUIElement.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);

It worked for me, so it might be worth a try!

like image 190
Markus Hütter Avatar answered Oct 21 '22 13:10

Markus Hütter