WPF: RotateTransform and anti-aliasing

  • Thread starter Thread starter Julia M
  • Start date Start date
J

Julia M

Hi,

I created a simple TabControl

<TabControl >
<TabItem Header="A Header" />
<TabItem Header="Header No. 2" />
<TabItem Header="Yet another Header" />
</TabControl>

and it looked fine ... until I applied a RotateTransfrom like

<TabControl >
<TabControl.LayoutTransform>
<RotateTransform Angle="90" />
</TabControl.LayoutTransform>

<TabItem Header="A Header" />
<TabItem Header="Header No. 2" />
<TabItem Header="Yet another Header" />
</TabControl>

and the selected TabItems get all fuzzy.
Take a look at http://yfrog.com/2pwpf1jx to see the effect.

It doesn't matter at all whether I rotate the whole control or just
it's TabItems. Even SnapToDevicePixels won't snap the thing out off
looking like crap.

Any idea what is causing this and how to fix it?
 
[...]
and the selected TabItems get all fuzzy.
Take a look at http://yfrog.com/2pwpf1jx to see the effect.

It doesn't matter at all whether I rotate the whole control or just
it's TabItems. Even SnapToDevicePixels won't snap the thing out off
looking like crap.

Any idea what is causing this and how to fix it?

Unfortuantely, WPF and fuzzy go hand-in-hand. WPF has a completely new
kind of rendering model as compared to GDI. In particular, it's intended
from the ground-up to be resolution independent, which in turn results in
heavy dependence on anti-aliasing.

I don't know enough about WPF to know the specifics, but I seem to recall
that there may be a setting you can apply to force it to do pixel-exact
rendering, and/or disable anti-aliasing. Barring that, you might post
your question in a WPF forum, where WPF questions are actually on-topic,
and where people who actually know a fair amount about WPF would actually
read your post. Your ability to get detailed advice on the question may
be limited in this forum.

Pete
 
On Oct 6, 11:35 am, "Peter Duniho" <[email protected]>
wrote:

Thanks for your reply
I seem to recall  that there may be a setting you can apply to force itto do pixel-exact  
rendering, and/or disable anti-aliasing.

That's what SnapsToDevicePixels is supposed to do. It didn't do much
good :-(
you might post  your question in a WPF forum

Do you have a specific forum in mind?
There actually is no newsgroup dealing with WPF :-/
 
[...]
you might post  your question in a WPF forum

Do you have a specific forum in mind?
There actually is no newsgroup dealing with WPF :-/

No, there's not, much to my annoyance. Microsoft has chosen to rely
solely on a web forum for WPF. I don't know the exact URL, but I'm sure
Google can help you with that.
 
Julia said:
Hi,

I created a simple TabControl

<TabControl >
<TabItem Header="A Header" />
<TabItem Header="Header No. 2" />
<TabItem Header="Yet another Header" />
</TabControl>

and it looked fine ... until I applied a RotateTransfrom like

<TabControl >
<TabControl.LayoutTransform>
<RotateTransform Angle="90" />
</TabControl.LayoutTransform>

<TabItem Header="A Header" />
<TabItem Header="Header No. 2" />
<TabItem Header="Yet another Header" />
</TabControl>

and the selected TabItems get all fuzzy.
Take a look at http://yfrog.com/2pwpf1jx to see the effect.

It doesn't matter at all whether I rotate the whole control or just
it's TabItems. Even SnapToDevicePixels won't snap the thing out off
looking like crap.

Any idea what is causing this and how to fix it?

Hi Julia,

Try setting VerticalContentAlignment to "Stretch".
It give better result on my system.

Regards.
 
Back
Top