XCreatePixmapCursor()XCreatePixmapCursor()Name
XCreatePixmapCursor – create a cursor from two bitmaps.
Synopsis
Cursor XCreatePixmapCursor(display, source, mask, foreground_color,
background_color, x, y)
Display *display;
Pixmap source;
Pixmap mask;
XColor *foreground_color;
XColor *background_color;
unsigned int x, y;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
source Specifies the shape of the source cursor. A pixmap of depth
1.
mask Specifies the bits of the cursor that are to be displayed
(the mask or stipple). A pixmap of depth 1. May be None.
foreground_color
Specifies the red, green, and blue (RGB) values for the fore‐
ground.
background_color
Specifies the red, green, and blue (RGB) values for the back‐
ground.
x Specify the coordinates of the cursor's hotspot relative to
y the source's origin. Must be a point within the source.
Returns
The created cursor.
DescriptionXCreatePixmapCursor() creates a cursor and returns a cursor ID. Fore‐
ground and background RGB values must be specified using fore‐
ground_color and background_color, even if the server only has a mono‐
chrome screen. The foreground_color is used for the 1 bits in the
source, and the background is used for the 0 bits. Both source and
mask (if specified) must have depth 1, but can have any root. The mask
pixmap defines the shape of the cursor; that is, the 1 bits in the mask
define which source pixels will be displayed. If no mask is given, all
pixels of the source are displayed. The mask, if present, must be the
same size as the source.
The pixmaps can be freed immediately if no further explicit references
to them are to be made.
For more information on cursors, see Volume One, Chapter 6, Drawing
Graphics and Text.
Structures
typedef struct {
unsigned long pixel;
unsigned short red, green, blue;
char flags; /* DoRed, DoGreen, DoBlue */
char pad;
} XColor;
Errors
BadAlloc
BadMatch Mask bitmap must be the same size as source bitmap.
BadPixmap
See AlsoXCreateBitmapFromData(), XDefineCursor(), XCreateFontCursor(), XCre‐
atePixmap(), XCreatePixmapCursor(), XFreeCursor(), XFreePixmap(),
XQueryBestCursor(), XQueryBestCursor(), XQueryBestSize(), XQueryBest‐
Size(), XReadBitmapFile(), XRecolorCursor(), XUndefineCursor().
Xlib - Pixmaps and Tiles XCreatePixmapCursor()