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

Home » Public Forums » archive » y_width of xyouts
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
y_width of xyouts [message #17449] Tue, 26 October 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Hi,

I like to know exactly the y_width of a text in normal coordinates.
I have written a small routine which unfortunately don't run with all
devices set.

Any other ideas are welcome

I know already !D.Y_CH_SIZE but its only useful on some windows systems.





FUNCTION y_width,text,x_width=width,_extra=e
old_dev=!d.name
IF STRUPCASE(!version.os_family) EQ 'WINDOWS' THEN dev='win' ELSE
dev='x'
SET_PLOT,dev
WINDOW,/free,/pixmap,retain=0
WSET,!D.WINDOW

XYOUTS,0,0.5,text,/NORM,width=width,color=1,charthick=10,ali gnment=alignment,_extra=e

image=TVRD()

SET_PLOT,old_dev
!p.background=255
!p.color=0
dim=SIZE(image,/dim)
idx=WHERE(image EQ MAX(image))/dim[0]
y_width=(FLOAT(MAX(idx))-FLOAT(MIN(idx)))/FLOAT(dim(1))
WDELETE,!D.WINDOW
RETURN,y_width
END
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: get_boundingbox
Next Topic: How to import an source interface ?

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

Current Time: Fri Oct 10 14:46:12 PDT 2025

Total time taken to generate the page: 0.24101 seconds