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

Home » Public Forums » archive » text objects and erroneous pixel resolution
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
text objects and erroneous pixel resolution [message #62585] Fri, 19 September 2008 15:00
Jean-Paul Davis is currently offline  Jean-Paul Davis
Messages: 17
Registered: March 1998
Junior Member
I have found that IDL obtains window resolution that is grossly in
error on certain platforms. For example, the statement

dimensions = GET_SCREEN_SIZE(RESOLUTION=resolution)

gives resolution on my screen of 0.025 cm/pixel in both the x and y
directions under Windows XP, which is correct. Running IDL under
Linux inside a VM Ware virtual machine window on this same computer,
however, gives resolution of 0.015258216 cm/pixel in x and
0.019455511 cm/pixel in y, which is clearly wrong for my screen. The
actual numbers returned depend on the size of the virtual machine
window. The numbers returned on Mac are also wrong, possibly related
to the problem in this thread:
http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/cd781aa11aba95e7/.

As a result, when text objects are first drawn, and subsequently
redrawn if they have RECOMPUTE_DIMENSIONS=2, the characters are the
wrong size and the wrong aspect ratio.

Pixel resolution properties are read-only, so IDL cannot be
"tricked." The only way I see around the issue is to set
RECOMPUTE_DIMENSIONS=0 and "correct" the CHAR_DIMENSIONS of all text
objects. This requires updating CHAR_DIMENSIONS every time your data
coordinates change.

In my application, I use the text size to adjust the viewplane
rectangle so that there is appropriate space for the title and tick
labels between the edges of the draw window and the axes.
Unfortunately, the text size returned by either the
IDLgrWindow::GETTEXTDIMENSIONS method or the XRANGE, YRANGE properties
of text objects seems to give the size the text would have if
CHAR_DIMENSIONS were set to zero (and hence text were sized according
to what IDL thinks the pixel resolution is). Setting CHAR_DIMENSIONS
(with RECOMPUTE_DIMENSIONS=0) and redrawing changes the text on the
screen, but not the values returned by GETTEXTDIMENSIONS or X/YRANGE.

Has anyone seen IDL behave differently than this, or know of a
workaround to get object text to display at the correct size and
aspect ratio when IDL obtains the wrong pixel resolution, or at least
get the correct dimensions?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MAP_SET problem
Next Topic: Creating DLMs that have IDL code in it

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

Current Time: Wed Oct 08 16:00:34 PDT 2025

Total time taken to generate the page: 0.00394 seconds