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.
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.