Re: Explicit text formatting for Object Axes [message #16895 is a reply to message #16829] |
Wed, 25 August 1999 00:00   |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
David Fanning wrote:
<blockquote TYPE=CITE>
<p>I would just make sure your axes are scaled into your
<br>view before you muck around with your fonts. This will
<br>ensure that they are scaled "proportionally" to the
<br>axis they are attached to. Then, as you change axis
<br>scaling, these will change too. :-)
<br>
<br> </blockquote>
Oops, I thought that vector drawn fonts were scaled but hardware fonts
<br>were 'hard'. I tinkered with Xplot and can see what you
mean about
<br>needing to have scaleable fonts. Duh!
<p>I've combed through my code regarding axis scaling and can't figure
out what
<br>is going on. The first time I launch the application, the fonts
are
<br>'proportional and quite readable'. If I load a new differently
sized image
<br>into the application the fonts are scaled badly. Now, if I load
a third image of identical size to the very first image the font scaling
returns to its 'proportional and quite readable' scaling.
<p>Below is the code embedded in the event handler that loads a new image.
<p>;
<br>;
<br>;
<br>
<br>
<p> ;get the dimensions of the new image called Value
<br>info.Origsz = SIZE(*info.Value, /dimensions)
<br>
<br> ; establish the range of values
<br>Xrange = [0,info.Origsz[0]]
<br>Yrange = [0,info.Origsz[1]]
<p> ;normalize the range
<br>info.OrigXscale = Normalize(Xrange, position = [0,1])
<br>info.OrigYscale = Normalize(Yrange, position = [0,1])
<p> ; make the window slightly larger than the dimensions of the image
<br>xsize = info.Orig_rect[2]*info.Origsz[0]
<br>ysize = info.Orig_rect[3]*info.Origsz[1]
<br>widget_control, info.OrigDrawID, $
<br> xsize =xsize , $
<br> ysize = ysize
<p> ; load the new data into the image object with
<br> ; the normalized X and Y scaling
<br>info.oOrig -> setProperty, $
<br> Data = *info.image, $
<br> Xcoord_conv = info.OrigXscale, $
<br> Ycoord_conv = info.OrigYscale
<p> ; change the data range and scaling for the X axis
<br> ; the Exact keyword has already been set to 1
<br>info.oOrigXaxis1 ->setProperty, $
<br> range = xrange, $
<br> Xcoord_conv = info.OrigXscale
<br>
<p>;
<br>;
<br>;
<p>So, I think I'm setting the axis scaling correctly ... but, clearly,
I am not.
<br>It seems that IDL has developed a scaling memory that I can't override.
gak!
<p>Thanks,
<br>
<p>Ben
<br>
<pre>--
Ben Tupper
Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org
Pemaquid River Company
pemaquidriver@tidewater.net</pre>
</html>
|
|
|