Re: Getting info on the whole screen in IDL [message #3573] |
Tue, 21 February 1995 01:45 |
sjt
Messages: 72 Registered: November 1993
|
Member |
|
|
Wayne Landsman (301)-286-3625 (landsman@sorbet.gsfc.nasa.gov) wrote:
: In article <3i2euu$knu@adam.cc.sunysb.edu>, Chris Jacobsen
: <jacobsen@xray1.physics.sunysb.edu> writes...
: >The IDL parameters !D.X_SIZE and so forth tell you information
: >about the active display window (at least as far as I can tell).
: >
: >I wanted to be able to find about the whole screen so as to
: >decide how big to make windows and fonts and so on.
: >
: >I have written a routine
: > IDL> xpixels,xpix,ypix,xmm,ymm
: > IDL> print,xpix,ypix,xmm,ymm
: > 1024 768 283.000 212.000
: The GET_SCREEN_SIZE keyword to the DEVICE command under X windows will give
: you the size of the entire screen in pixels. I think you still have to link
: to the C program to get the size in mm.
Not if the screen is properly set up. The GET_SCREEN_SIZE gives the screen
size and the !D.[xy]_px_cm give the pixels/cm. From which it is trivial
to extract the size of the screen in cm.
: --Wayne Landsman landsman@stars.gsfc.nasa.gov
--
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 021-414-6462. Fax: 021-414-3722 | |
+----------------------------------------------------------- --+---------+
|
|
|
Re: Getting info on the whole screen in IDL [message #3582 is a reply to message #3573] |
Sun, 19 February 1995 18:15  |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
In article <17FEB199512365904@sorbet.gsfc.nasa.gov>,
landsman@sorbet.gsfc.nasa.gov (Wayne Landsman (301)-286-3625) writes...
> The GET_SCREEN_SIZE keyword to the DEVICE command under X windows will give
> you the size of the entire screen in pixels. I think you still have to link
> to the C program to get the size in mm.
>
David Fanning of RSI pointed out that the !D.X_PX_CM and !D.Y_PX_CM system
variables can be used to convert the screen size to mm. Below I give
a simple program XPIXELS to return the screen size.
I note that the !D system variable contains information applicable
to all graphics devices, while the total screen size is a concept that only
makes sense for devices that support windows. I suppose this is why the
screen size information is not in the !D system variable, but must be
accessed through the DEVICE command.
--Wayne Landsman landsman@stars.gsfc.nasa.gov
pro xpixels,xpix,ypix,xmm,ymm
;Return the screen size in pixels (xpix,ypix) and mm (xmm,ymm)
;Works on devices that support windows ('X','WIN','MacOS')
device,get_screen_size = scrsz
xpix = scrsz(0) & ypix = scrsz(1)
xmm = 10.*xpix/!D.X_PX_CM
ymm = 10.*ypix/!D.Y_PX_CM
return
end
|
|
|
Re: Getting info on the whole screen in IDL [message #3592 is a reply to message #3582] |
Fri, 17 February 1995 09:36  |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
In article <3i2euu$knu@adam.cc.sunysb.edu>, Chris Jacobsen
<jacobsen@xray1.physics.sunysb.edu> writes...
> The IDL parameters !D.X_SIZE and so forth tell you information
> about the active display window (at least as far as I can tell).
>
> I wanted to be able to find about the whole screen so as to
> decide how big to make windows and fonts and so on.
>
> I have written a routine
> IDL> xpixels,xpix,ypix,xmm,ymm
> IDL> print,xpix,ypix,xmm,ymm
> 1024 768 283.000 212.000
The GET_SCREEN_SIZE keyword to the DEVICE command under X windows will give
you the size of the entire screen in pixels. I think you still have to link
to the C program to get the size in mm.
--Wayne Landsman landsman@stars.gsfc.nasa.gov
|
|
|