Formula for pixel to millimeter and vice versa - PHP Views : 1286
Tagged in : PHP
0 0
Send mail
Millimeter to Pixel
*******************
$pixels = ($mm * $dpi) / 25.4

Pixel to Millimeter
*******************

$mm = ($pixels * $25.4) / dpi


ex : milli meter to pixel
*************************
Let me explain a little bit.

1 inch = 25.4 mm

If we assume a resolution of e.g. 300 dpi (that's 300 dots or pixels per inch)
then 100 mm (being approx. 4 inches) is 300*4 = 1200 pixels

The formula gives:
100 * 300 / 25.4 = 1181 pixels
By satheesh, On - 2010-01-28



    Login to add Comments .