<<<<<<<<<<<<<<<<

xpixmap(x) Xlib xpixmap(x)

NAME

xpixmap - an X pixmap

DESCRIPTION

The xpixmap class provides an interface to an X Pixmap structure.

SUPERCLASS

xdrawable

INSTANCE VARIABLES

drawable is the name of an xdrawable instance. It is used to get the screen for the pixmap. The default value is the default root window for the display.

MESSAGES

create! creates the pixmap and sets the id instance variable.

drawable= drawable_object_name sets the drawable instance variable.

drawable? returns the value of the drawable instance variable on the argument stack.

dump:filename xwindow_instance dumps the pixmap to an xwd (xwindow dump) file named using filename. The xwindow instance is used to access colormap and visual information.

id=pixmap_pointer sets the id of the pixmap. This method has the side effect of setting the width, height and depth also.

read_pixmap_file: filename, restore: filename read the pixmap file and create the pixmap from the data. The format of the file is the same as the format for xwd files.

This message accepts an optional second and third arguments (note: you must supply both!) which is the name of an xcolormap instance and the name of an xvisual instance. If you supply these arguments, a colormap and visual will be created and the ids of these objects will be set. Pixels will be allocated in this colormap for the pixmap.

If you do not supply these arguments, pixels will be allocated in the default colormap. Since the default colormap is shared by other resources, all

colors may not be available, but the closest matches will be used instead.

write_pixmap_file:filename xwindow_instance is an alias for the dump: message.

EXAMPLE

/* create a pixmap */

xshared_cell new: red_cell color: red; xshared_cell new: white_cell color: white; xshared_cell new: blue_cell color: blue; xshared_cell new: green_cell color: green; xshared_cell new: yellow_cell color: yellow;

xgc new: white_gc foreground= [white_cell pixel?] background= [white_cell pixel?] create! ; xgc new: blue_gc foreground= [blue_cell pixel?] background= [white_cell pixel?] create! ; xgc new: yellow_gc foreground= [yellow_cell pixel?] background= [white_cell pixel?] create! ;

xpixmap new: apixmap width= 250 height= 22 depth= 8 create! gc= white_gc -- draw in background of pixmap... fill_rectangle: (0, 0, 250, 22) gc= yellow_gc -- draw a smiley face in the pixmap fill_arc: (230, 5, 15, 15, 0, 360) gc= blue_gc draw_arc: (229, 4, 17, 17, 0, 360) fill_arc: (235, 7, 3, 4, 0, 360) fill_arc: (240, 7, 3, 4, 0, 360) draw_arc: (233, 10, 10, 6, 180, 180) ;

SEE ALSO

xdrawable


Last Updated On: Fri Mar 10 15:38:47 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache