On Mon, 24 Sep 2001, Jason T. S. Chow wrote:
> Hi all,
>
> After I have set double buffering of a swing component off by
> setDoubleBuffered(false), I found that the screen resolution is 96,
> from getToolkit().getScreenResolution(). Why is 96? And is there any
> way to set screen resolution?I am using 800 x 600 screen size, using
> Window 98 and JDK 1.3.1.
I've found that regardless of my actual screen resolution,
getScreenResolution() always returns 96. Perhaps it's just meant
to be in the ballpark of a typical monitor resolution.
I posted this result in a previous thread ("User space -
device space conversion") but received no response.
Looking at the source (for j2sdk1.3.1 win32), I think
getScreenResolution() is ultimately calling the Windows GDI
GetDeviceCaps() function, querying the LOGPIXELSX attribute, which
according the API reference is
Number of pixels per logical inch along the screen width. In a system
with multiple display monitors, this value is the same for all monitors.
I don't know enough about windows programming to tell you whether it
should change with the resolution. You'd think it would, though.
-David
-----------------------------------------------------
David Eisner | E-mail: [EMAIL PROTECTED] |
CALCE EPSC | Phone: 301-405-5341 |
University of Maryland | Fax: 301-314-9269 |
-----------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".