I have a need to convert Pixels to Points in C#. I've seen some complicated explanations about the topic, but can't seem to locate a simple formula. Let's assume a standard 96dpi, how do I calulate this conversion?

@David that article just explains why monitors have variable DPI. PPI is still the same. The number of kilometers in a mile doesn't change depending on the car you drive. Assuming 96dpi is generally not a good idea, but if we do that then the given formula is correct.
–
QuentinSep 26 '08 at 14:39

6

Usually PPI is the abbreviation for pixels per inch, not points per inch. Perhaps that's where the confusion comes from? Points per inch are always 72; thanks for the link Xetius.
–
Mark RansomJul 3 '09 at 15:59

"How do I obtain the horizontal and vertical PPI (Pixels Per Inch) of the monitor?"

There are 72 points in an inch (by definition, a "point" is defined as 1/72nd of an inch, likewise a "pica" is defined as 1/72nd of a foot). With these two bits of information you can convert from px to pt and back very easily.

To make it even more complicated, I'm dealing with aligning things on a an Reporting Services (RDL) report which is being converted into a PDF. At the end of the day, who the heck knows what the DPI is? I'm using my best guess. :)
–
Todd DavisSep 26 '08 at 14:38

You mean "How do I obtain the horizontal and vertical DPI of the monitor?". PPI is a constant of 72. Always has been and always will.
–
XetiusJul 3 '09 at 12:14