comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » determining the display size (IDL)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
determining the display size (IDL) [message #17885] Wed, 17 November 1999 00:00 Go to next message
Rick Baer is currently offline  Rick Baer
Messages: 6
Registered: November 1999
Junior Member
I would like to determine desktop display resolution from IDL
(under Windows). I thought that I could use !D.X_SIZE, but I
get the size of the most recently accessed window. Any
suggestions?

-Rick Baer-
Senior Member of Technical Staff
Hardcopy Technology Laboratory
Hewlett-Packard Laboratories
Re: determining the display size (IDL) [message #17960 is a reply to message #17885] Thu, 18 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Robert S. Mallozzi (mallors@msfc.nasa.gov) writes:

> You might want use the GET_SCREEN_SIZE () function
> instead, as it won't crash if the device is
> not set "properly":
>
> IDL> PRINT, !D.NAME
> X
> IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
> 1024 768
> IDL> s = GET_SCREEN_SIZE () & PRINT, s
> % Compiled module: GET_SCREEN_SIZE.
> 1024.00 768.000
> IDL> SET_PLOT, 'PS'
> IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
> % Keyword GET_SCREEN_SIZE not allowed in call to: DEVICE
> % Execution halted at: $MAIN$
> IDL> PRINT, !D.NAME
> PS
> IDL> s = GET_SCREEN_SIZE () & PRINT, s
> 1024.00 768.000

Whoa! Did you see the code for GET_SCREEN_SIZE!?

They realize an *unmapped* object draw widget
on the device. Then get the screen dimensions
from the window object. Nice trick, because
devices that don't support windows don't complain
until a window actually shows up on the display,
which this one never does.

Who said objects weren't powerful! :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: determining the display size (IDL) [message #17962 is a reply to message #17885] Thu, 18 November 1999 00:00 Go to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <MPG.129ce5a38d765b1e989975@news.frii.com>,
davidf@dfanning.com (David Fanning) writes:
> Rick Baer (baer@hpl.hp.com) writes:
>
>> I would like to determine desktop display resolution from IDL
>> (under Windows). I thought that I could use !D.X_SIZE, but I
>> get the size of the most recently accessed window. Any
>> suggestions?
>
> I use this:
>
> IDL> Device, Get_Screen_Size=thisScreenSize
> IDL> Print, thisScreenSize
>
> Cheers,
>
> David

You might want use the GET_SCREEN_SIZE () function
instead, as it won't crash if the device is
not set "properly":

IDL> PRINT, !D.NAME
X
IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
1024 768
IDL> s = GET_SCREEN_SIZE () & PRINT, s
% Compiled module: GET_SCREEN_SIZE.
1024.00 768.000
IDL> SET_PLOT, 'PS'
IDL> DEVICE, GET_SCREEN_SIZE = s & PRINT, s
% Keyword GET_SCREEN_SIZE not allowed in call to: DEVICE
% Execution halted at: $MAIN$
IDL> PRINT, !D.NAME
PS
IDL> s = GET_SCREEN_SIZE () & PRINT, s
1024.00 768.000
IDL>


Regards,
-bob


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code SD 50
http://gammaray.msfc.nasa.gov/ Marshall Space Flight Center
http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Curve detection
Next Topic: Memory used/available

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:24:48 PDT 2025

Total time taken to generate the page: 0.00595 seconds