convert pixel to centimeters

B

Brenny

Hello, I want to convert pixel values to centimeters values. For example
start point is 100,100 pixel and stop point is 200,100 pixel.
distance is what cm?

How can I calculate distance as centimeters?
 
A

Adman

This would depend completely on the size of your physical display,
wouldn't it?

If you have a 12.8 centimeter display showing a 1280x1024 image, then
you have 100 pixels per centimeter.

Right?
 
B

Bruce Wood

You might look at the following articles on MSDN:

http://support.microsoft.com/default.aspx?scid=kb;en-us;127152

If you're not as picky as the above article, you can always use the
DpiX and DpiY properties of the Graphics object on which you're
drawing. (You must always determine pixels to inches based on some
output device... the conversion is meaningless in the absence of a
graphics context of some kind.) In DpiX and DpiY, the "D" stands for
"dots" or pixels, while the "i" stands for "inches". So, you can
convert pixels to inches. Then all you have to do is convert inches to
centimeters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top