Re: the "real" screen size [message #73022 is a reply to message #73021] |
Mon, 25 October 2010 07:17   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
alx writes:
> On Linux, after the window creation, do you see only a black screen ?
> If not, as it is the case on my Windows box (I can see window frames,
> system taskbar, etc...), !D.X_SIZE and !D.Y_SIZE does not give you the
> drawing size for your image.
> alx.
I think everyone is getting a bit confused here. Let me
see if I can summarize. The problem we are trying to
solve is that we want to create a window on the display
that is as big as possible, without being obscured by
window decorations, borders, etc. The question we are
trying to ask is "How can we find the size of that
window in a machine-independent way?"
One would think that the Get_Screen_Size keyword
to the Device command would work:
IDL> Device, Get_Screen_Size=theSize
IDL> Print, thesize
1280 1024
The problem is, if you make a window of this size, it
is "too big" for the window. It is obscured.
Carsten's solution for LINUX is to make a window this
size anyway (probably as a pixmap, I would assume) and
then examine the variables !D.X_Size and !D.Y_Size. These
will contain the sizes you are looking for.
UNIX:
IDL> Window, XSIZE=theSize[0], YSIZE=theSize[1]
IDL> Print, !D.X_Size, !D.Y_Size
1278 944
Alas, this doesn't work for Windows computers:
WINDOWS:
IDL> Window, XSIZE=theSize[0], YSIZE=theSize[1]
IDL> Print, !D.X_Size, !D.Y_Size
1280 1024
So, we are still looking for a machine-independent solution.
At the moment, however, we only have to calculate fudge
factors for Windows machines, which is an improvement.
These fundge factor only depend on which version of Windows
you are using, how you have configured your machine, and
other factors too numerous to mention. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|