|
|
Formula for pixel to millimeter and vice versa - PHP
|
Views : 1286
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|