Welcome to MSDN Blogs Sign in | Join | Help

Lester's WPF blog


Simple, easy & beautiful

News

New WPF Features: LayoutRounding

This is part of a series on New WPF Features

LayoutRounding - If you are familiar with Silverlight, this is nothing new. If you are unfamiliar with it, all it does is that it rounds up lengths..

Take for example the code below (hypothetical case) 

<Border Width="33.9111111" Height="80.11111" BorderBrush="Red" Margin="2.1222222" BorderThickness="3.955">
<
Border Width="15.3333333" Height="40.11111" BorderBrush="Black" Margin="2.3333333" BorderThickness="3.89898555"></Border>

The one on the left is a bit blurry due to the subpixel positioning and doesnt use LayoutRounding. The one on the left is rendered with LayoutRounding and has crisper lines.

The property to enable LayoutRounding is UseLayoutRounding="true" ... By default this is set to false (unlike SL)

You can also take a look at the MSDN documentation

Share this post

 

Posted: Friday, October 30, 2009 3:47 PM by llester

Comments

Rico Alexander said:

What's SL and how do you and where do you set the LayoutRounding.

# October 31, 2009 11:06 AM

Rico Alexander said:

What's SL and how do you and where do you set the LayoutRounding.

# October 31, 2009 11:06 AM

llester said:

SL--> Silverlight.. layout rounding comes by default

# October 31, 2009 2:17 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker