Re: how to convert metric to pixels
- From: Thomas Fritsch <i.dont.like.spam@xxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 09:50:44 GMT
Rita Leon wrote:
What are the methods/classes in JFC to convert millimeters (or inchesYou can call
or centimeters) to pixels?
I remember in windows programming we had DPtoLP() and LPtoDP(). Might
there be a Java equivalent?
int resolution = Toolkit.getDefaultToolkit().getScreenResolution();
to get your physical screen resolution (on my screen I get 96). Having that number, it is simple arithmetics to convert inches to pixels and vice versa.
See <http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Toolkit.html#getScreenResolution()>
--
Thomas
.
- Follow-Ups:
- Re: how to convert metric to pixels
- From: Rita Leon
- Re: how to convert metric to pixels
- References:
- how to convert metric to pixels
- From: Rita Leon
- how to convert metric to pixels
- Prev by Date: Re: Print a binary search tree
- Next by Date: Re: how to convert metric to pixels
- Previous by thread: how to convert metric to pixels
- Next by thread: Re: how to convert metric to pixels
- Index(es):
Relevant Pages
|
|