Annotation of 43BSDTahoe/new/X/doc/Xlib/ch06d.t, revision 1.1.1.1

1.1       root        1: .NH 2
                      2: Moving Bits and Pixels to and From the Screen
                      3: .PP
                      4: A few  programs may want to manipulate pixels that they later display on
                      5: the screen.
                      6: This section describes calls which will move pixels from the program to
                      7: the window system, or from the window system to the program.
                      8: Care must be taken to adhere to the data representation described at the
                      9: beginning of this document to keep programs portable between machine
                     10: architectures.
                     11: If you always manipulate Bitmaps and XY-format Pixmaps
                     12: in terms of 16 bit quantities, you will be quite safe.
                     13: .FD
                     14: .IN "Definitions" "XPixmapBitsPutXY"
                     15: .IN "XPixmapBitsPutXY"
                     16: .IN "Definitions" "XPixmapBitsPutZ"
                     17: .IN "XPixmapBitsPutZ"
                     18: .IN "Raster Op to Screen"
                     19: XPixmapBitsPutXY (w, x, y, width, height, data, mask, func, planes)
                     20:        short *data;
                     21: 
                     22: XPixmapBitsPutZ (w, x, y, width, height, data, mask, func, planes)
                     23:        Window w;
                     24:        int x, y, width, height;
                     25:        caddr_t data;
                     26:        Bitmap mask;    /* which bits to modify */
                     27:        int func;       /* display function */
                     28:        int planes;     /* plane mask */
                     29: .FN
                     30: \fIXPixmapBitsPut\fP copies client-supplied bits into a window according to the
                     31: specified display function in the format specified by the name of the 
                     32: procedure.
                     33: .PP
                     34: .IN "XY-Format Pixmap"
                     35: .IN "Z-Format Pixmap"
                     36: See the section on data representation for the
                     37: difference between XY and Z format pixmaps.
                     38: .PP
                     39: The area modified will be controlled by the \fImask\fP argument, if it is
                     40: nonzero.
                     41: Only the bits in the \fImask\fP will be modified on the screen.
                     42: .IN "Icon" "Display"
                     43: This is often useful for Icon generation.
                     44: .FD
                     45: .IN "Definitions" "XBitmapBitsPut"
                     46: .IN "XBitmapBitsPut"
                     47: XBitmapBitsPut (w, x, y, width, height, data, foreground, background, mask, func, planes)
                     48:        Window w;
                     49:        int x, y, width, height, foreground, background;
                     50:        short *data;
                     51:        Bitmap mask;    /* which bits to modify */
                     52:        int func;       /* display function */
                     53:        int planes;     /* plane mask */
                     54: .FN
                     55: Performs a function in a region of the window using a pixmap defined by a 
                     56: bitmap and a pair of source pixels defining the \fIforeground\fP
                     57: and \fIbackground\fP
                     58: pixel values.
                     59: The plane mask defines which destination bit planes are affected.
                     60: The display function is computed on each bit plane.
                     61: .PP
                     62: See the section on data representation for the format of Bitmap data.
                     63: .PP
                     64: The area modified will be controlled by the \fImask\fP argument.
                     65: Only the bits in the \fImask\fP will be modified on the screen.
                     66: This is often useful for Icon generation.
                     67: .IN "Icon" "Display"
                     68: .FD
                     69: .IN "Definitions" "XPixmapSave"
                     70: .IN "XPixmapSave"
                     71: .IN "Saving Bits from Screen"
                     72: Pixmap XPixmapSave (w, x, y, width, height)
                     73:        Window w;
                     74:        int x, y, width, height;
                     75: .FN
                     76: \fIXPixmapSave\fP creates a Pixmap from the given portion of the window.
                     77: The
                     78: pixmap will contain a direct image of that portion of the screen,
                     79: including any visible portions of subwindows or overlapping windows, so
                     80: this routine should be used with caution.
                     81: Its main use will probably be
                     82: .IN "Menus"
                     83: .IN "XUnmapTransparent"
                     84: in conjunction with \fIXUnmapTransparent\fP, in implementing pop-up menus or
                     85: other `temporary' windows which save the bits under them and then
                     86: restore those bits when destroyed.
                     87: .PP    
                     88: The window must be mapped, and it must be true that if there were no
                     89: overlapping windows or subwindows, the specified portion of the window
                     90: would be fully visible on the screen.
                     91: .PP
                     92: The function returns the Pixmap id for the saved pixmap, or 0
                     93: if it failed.
                     94: .FD
                     95: .IN "Definitions" "XPixmapGetXY"
                     96: .IN "XPixmapGetXY"
                     97: .IN "Definitions" "XPixmapGetZ"
                     98: .IN "XPixmapGetZ"
                     99: .IN "Retrieving Bits from the Screen"
                    100: XPixmapGetXY (w, x, y, width, height, data)
                    101: 
                    102: XPixmapGetZ (w, x, y, width, height, data)
                    103:        Window w;
                    104:        int x, y, width, height;
                    105:        short *data;    /* RETURN */
                    106: .FN
                    107: \fIXPixmapGet\fP returns the pixmap in the specified format into the specified
                    108: area of memory.
                    109: .PP
                    110: See the section on data representation to determine
                    111: how large the area of memory must be reserved for the returned data.
                    112: This function is intended for screen dump purposes.
                    113: .PP
                    114: The window must be mapped and it must be the case that if there were
                    115: no subwindows or overlapping windows, the specified portion of the window
                    116: would be fully visible on the screen.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.