Re: how to convert metric to pixels
- From: Rita Leon <dingo@xxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 19:55:57 GMT
On Fri, 26 Oct 2007 09:50:44 GMT, Thomas Fritsch
<i.dont.like.spam@xxxxxxxxxxx> wrote:
You idea is possible but the number of pixels per unit will vary
depending on the physical size of the monitor and the size of a pixel.
A 17" monitor @ 1024x768 will have a different number of pixels per
unit than a 22" monitor @ 1024x768. And then there is the issue of
dot pitch...
ty for the suggestion.
You can call
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()>
.
- Follow-Ups:
- Re: how to convert metric to pixels
- From: Eric Sosman
- Re: how to convert metric to pixels
- From: Thomas A. Russ
- Re: how to convert metric to pixels
- References:
- how to convert metric to pixels
- From: Rita Leon
- Re: how to convert metric to pixels
- From: Thomas Fritsch
- how to convert metric to pixels
- Prev by Date: Re: how to convert metric to pixels
- Next by Date: Re: how to convert metric to pixels
- Previous by thread: Re: how to convert metric to pixels
- Next by thread: Re: how to convert metric to pixels
- Index(es):
Relevant Pages
|
|