Re: strange output with xyouts [message #85236 is a reply to message #85235] |
Thu, 18 July 2013 06:03   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
yfjulien.pub@gmail.com writes:
> This is my first time here, until now I managed to find answers to my problems through internet and forum searches but this time I couldn't find anything.
>
> I am experiencing a strange IDL behaviour with the xyouts function. I am using it to put a time stamp (such as '2013-01-01 09H59') on an satellite image, with the following code:
>
> device, retain=2, decomposed=0
> loadct, 0, /silent
> window, 2, xsize=1354, ysize=200
> wset, 2
> xyouts, 677, 50, '2013-01-01 09H59', $ alignment=.5,charsize=10,charthick=10,color=255, /device
> dateLegend = tvrd(true=3)
> wdelete, 2
>
> Now comes the problem: sometimes I get the dateLegend right, and sometimes not. More exactly, some times I get what I expect, the '2013-01-01 09H59' time stamp which is then inserted in my satellite image, but sometimes I only get a dot at the (677,50) position, and that's it. Since this code is inserted in a big loop over different images, and that this 'not working' behaviour only affects some of the images, with a frequence that seems random to me, I am quite
puzzled.
>
> I have tried the cgText function from the coyote library, I get the same dot result for the cases that are not working with xyouts. When I change the font (!p.font = 0; instead of !p.font=-1) I get the output text OK, but then I am unable to get it as big as I need.
>
> Has anyone experienced this kind of (I suppose) font problem with xyouts?
This doesn't sound to me like it has anything at all to do with XYOutS.
It is more likely that it is a problem with how the string is being
created and its interaction with the true-type font (which you don't
identify).
If I were a betting man, I would bet on there being a byte value
involved in the string creation part of the code (perhaps unexpectedly),
and that when this byte value gets converted to a string it results in
an unprintable ASCII character instead of a number.
I also doubt this happens "randomly". That's just too weird. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|