# Silverlight Units of Measurement

• ### Question

• Hi,

I'm still confused over the units of measurement in Silverlight. Here is my problem:

I want to build and application which will allow a user to edit a graphic and then print it. Now I would like to also include a border around the graphic to specify the "work area". When I'm designing all this in Silverlight, all the units are specified in pixels, but I need all the graphical elements to be based on inches.

How do I go about doing this to make sure than 1" element is also 1" on any monitor?

Max

Thursday, August 25, 2011 12:55 PM

### All replies

• So if you cannot set like the unit of measure as inches you can always do some simple math to convert to to inches. This is about the only way. You'll have to get access to that information and Im not sure how. You have to figure out the DPI (Dots per Inch) and then convert from inches to pixels

Thanks,

Thursday, August 25, 2011 2:52 PM
• I was hoping for an easier solution  :\

Thursday, August 25, 2011 3:11 PM
• Yea np, just make sure you look back at the first post I did. I gave you some mis-information about pixels and math in case you got the email with that.

Also this is WPF but you might be able to do the same with Silverlight but might require certain permission and out of browsers:

http://blogs.microsoft.co.il/blogs/tomershamam/archive/2007/11/30/wpf-is-dpi-depended.aspx

Thanks,

Thursday, August 25, 2011 3:31 PM
• Hi,

all the units are specified in pixels, but I need all the graphical elements to be based on inches.

According to your description ,as Darrk Assassin mentioned that you can convert the units from pixels to inches. I would like to suggest you to refer the links below for some similar threads which provide some solutions for how to convert pixels to inches.

Convert Pixel to inch in Silverlight

Convert Pixels to Inches and vice versa in C#