Re: Writing on an image [message #52097] |
Tue, 09 January 2007 10:16  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> RETURN, BytScl(image) > snap
Whoops, should read:
RETURN, BytScl(image, Top=254) > snap
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Writing on an image [message #52098 is a reply to message #52097] |
Tue, 09 January 2007 10:13   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ingo von Borstel writes:
> I like to create a sequence of images where I want to insert information
> into it.
> The images are each stored as usual array: image=INTARR(dimx,dimy)
>
> Is there a possibility to add text to these images (overprint it onto
> this array) like I could for example add text to a displayed image using
> XYOUTS?
Here is a quick and dirty way to do this. You can add
the bells and whistles. :-)
;******************************************************
FUNCTION SignImage, image
; Image assumed to be 2D array.
IF N_Elements(image) EQ 0 THEN Message, 'Must pass image to sign.'
text = 'Copyright FSC'
s = Size(image, /Dimensions)
; Set up Z-Buffer.
thisDevice = !D.Name
Set_Plot, 'Z'
Device, Set_Resolution=s, Z_Buffer=0
Erase
XYOutS, 0.1, 0.1, /Normal, Font=0, text, Color=255
snap = TVRD()
Set_Plot, thisDevice
RETURN, BytScl(image) > snap
END
;******************************************************
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|