This is a migrated thread and some comments may be shown as answers.

Converting from Inches to pixels

2 Answers 199 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jafin
Top achievements
Rank 2
Jafin asked on 04 Feb 2008, 01:05 AM
Could someone suggest a way to convert Unit of Inches to pixels. I've tried to get UnitConvert.ConvertTo going but if I understand correctly I need to plug in a EnumTypeConverter but the class is not public.

Thanks,
Jason

2 Answers, 1 is accepted

Sort by
0
Jafin
Top achievements
Rank 2
answered on 04 Feb 2008, 01:14 AM
I couldn't find a good way of doing this.  I've pulled the code out of unit.cs for ChangeType and made it public instead of internal.


0
Svetoslav
Telerik team
answered on 04 Feb 2008, 09:00 AM
Hello Jafin,

Conversion from Inches to pixels is straightforward. Since the pixels are device dependent units, you need the device resolution (DPI - dots per inch) and the calculation is like this:
Inches x DPI = Pixels
Pixels / DPI = Inches

DPI varies across different devices. For example the display's is usually 96 dpi while printers may have 300 or 600 dpi.

Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Jafin
Top achievements
Rank 2
Answers by
Jafin
Top achievements
Rank 2
Svetoslav
Telerik team
Share this question
or