开发者

WPF: RenderOptions.EdgeMode="Unspecified" vs "Alias" override global setting with local setting

开发者 https://www.devze.com 2023-01-02 04:14 出处:网络
in the ressource-tag of my MainWindowView.xaml I have this markup: RenderOptions.EdgeMode=\"Aliased\" to get a general sharp look of my whole application.

in the ressource-tag of my MainWindowView.xaml I have this markup:

RenderOptions.EdgeMode="Aliased" to get a general sharp look of my whole application.

Using mostly rectangular shapes/controls this works fine.

But for my validation error symbols I use a red ellipse with a white cross or "X" in it.

The ellipse is using now the global "Aliased" settings what looks not good beca开发者_运维技巧use I can see

the pixelated border of the ellipse.

Using now <Ellipse RenderOptions.EdgeMode="Unspecified" ... /> does NOT change anything ???

I always set in wpf local settings override global settings ?


Not for this case. MSDN states explicitly:

When you set the edge mode value of a visual object, all the child drawing primitives of that visual object are set to the same EdgeMode value.

I suspect this is because children are being rendered into their parent, so even if they're not anti-aliased, blitting them to an anti-aliased texture would make them anti-aliased too.

0

精彩评论

暂无评论...
验证码 换一张
取 消