Skip to main content

Java2D Pixels per inch?

1 reply [Last post]
Joined: 2008-08-21

How many pixels in one inch in Java2D?

If i draw a straight line in 2D , of 100 units, is this in pixels?

The reason for why i ask this is, i use java JDK6 update 14 on Ubuntu 9.04.
If i draw a line of 100 "units" in java, and i use the screenruler in Ubuntu, i measure the line as 50 pixels?

So how will i work out how many pixels / units java draw in one inch?
And is this pixels / units value independent of the platform?

Thanks in advance.

Theuns Heydenrych

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-08-21

I made a mistake with the code i wrote.

In the end it does measure correctly.