Reputation: 663
My problem is that what I size a picture according to millimeters to pixels, and then print it out this will never be exact. My question is there a way to make java draw in millimeters or any other metric unit stead of pixels, because pixils will never be exact to millimeters.
Upvotes: 2
Views: 7253
Reputation: 11
Doing some analysis, you could understand better:
pixels = mm * inch/mm * pixels/inch
pixels = mm (milimeters) * 25.4 (how many inches I have in 1 mm) * DPI (screen resolution)
DPI is dots per inch, which is the same of pixels per inch.
Upvotes: 1
Reputation: 663
Get the screen DPI
using java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
Then simply do (MM * DPI)/25.4
.
The outcome will be the amount of pixels relative to the physical length in MM.
Upvotes: 8