mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/directgraphics/

mg_textbackground.pro

includes main-level program

Routines

top mg_textbackground

mg_textbackground [, color=byte/long/bytarr(3)] [, alpha=float] [, location=lonarr(2)/fltarr(2)] [, dimensions=lonarr(2)/fltarr(2)] [, /data] [, /device] [, /normal]

Create a transparent box on a graphic. This can be used to create a background over an image suitable for display text on.

Keywords

color in optional type=byte/long/bytarr(3) default=0

color over background

alpha in optional type=float default=0.5

alpha blending between background and color; value is 0.0 to 1.0 where 0.0 is completely background and 1.0 is completely color

location in optional type=lonarr(2)/fltarr(2)

lower-left location of box to draw; default depends on the coordinate system, uses ![xy].crange in data coordinates, [0, 0] in device coordinates, [0., 1] in normal coordinates

dimensions in optional type=lonarr(2)/fltarr(2)

width and height of box

data in optional type=boolean

set to use data-coordinates (the default) for LOCATION and DIMENSIONS

device in optional type=boolean

set to use device coordinates for LOCATION and DIMENSIONS

normal in optional type=boolean

set to use normal coordinates for LOCATION and DIMENSIONS

Examples

For example, the main-level program at the end of this file makes use of this routine to make a box over an image suitable as a background for text. To run the example, do:

IDL> .run mg_textbackground
This should produce the following graphic:

The program displays an image, creates the text background, and then uses XYOUTS to place text over the image:

IDL> mg_image, read_image(file_which('people.jpg')), /new_window IDL> mg_textbackground, dimensions=[256, 40], alpha=0.75, /device IDL> xyouts, 10, 23, 'Ali Bahrami!CRSI first employee', $ IDL> /device, charsize=1.25, font=0

File attributes

Modification date: Wed May 14 15:07:15 2014
Lines: 53
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.