NAME

XPutImage, XGetImage, XGetSubImage - transfer images

SYNTAX

int XPutImage(Display *_d_i_s_p_l_a_y, Drawable _d, GC _g_c, XImage *_i_m_a_g_e, int _s_r_c___x, int _s_r_c___y, int _d_e_s_t___x, int _d_e_s_t___y, unsigned int _w_i_d_t_h, unsigned int _h_e_i_g_h_t); XImage *XGetImage(Display *_d_i_s_p_l_a_y, Drawable _d, int _x, int _y, unsigned int _w_i_d_t_h, unsigned int _h_e_i_g_h_t, unsigned long _p_l_a_n_e___m_a_s_k, int _f_o_r_m_a_t); XImage *XGetSubImage(Display *_d_i_s_p_l_a_y, Drawable _d, int _x, int _y, unsigned int _w_i_d_t_h, unsigned int _h_e_i_g_h_t, unsigned long _p_l_a_n_e___m_a_s_k, int _f_o_r_m_a_t, XImage *_d_e_s_t___i_m_a_g_e, int _d_e_s_t___x, _d_e_s_t___y);

ARGUMENTS

_d Specifies the drawable.
_d_e_s_t___i_m_a_g_e Specifies the destination image.
and are the coordinates of the subimage or which are relative to the origin of the destination rectangle, specify its upper-left corner, and determine where the subimage is placed in the destination image
_d_e_s_t___x
_d_e_s_t___y Specify the x and y coordinates, which are relative to the origin of the drawable.
_d_i_s_p_l_a_y Specifies the connection to the X server.
_f_o_r_m_a_t Specifies the format for the image.
You can pass _X_Y_P_i_x_m_a_p or _Z_P_i_x_m_a_p.
_g_c Specifies the GC.
_i_m_a_g_e Specifies the image you want combined with the rectangle.
_p_l_a_n_e___m_a_s_k Specifies the plane mask.
_s_r_c___x Specifies the offset in X from the left edge of the image defined
by the _X_I_m_a_g_e structure.
_s_r_c___y Specifies the offset in Y from the top edge of the image defined
by the _X_I_m_a_g_e structure.
_w_i_d_t_h
_h_e_i_g_h_t Specify the width and height of the subimage, which define the dimensions of the rectangle.
and define the upper-left corner of the rectangle
_x
_y Specify the x and y coordinates, which are relative to the origin of the drawable.

DESCRIPTION

The _X_P_u_t_I_m_a_g_e function combines an image with a rectangle of the specified drawable. The section of the image defined by the src_x, src_y, width, and height arguments is drawn on the specified part of the drawable. If _X_Y_B_i_t_m_a_p format is used, the depth of the image must be one, or a _B_a_d_M_a_t_c_h error results. The foreground pixel in the GC defines the source for the one bits in the image, and the background pixel defines the source for the zero bits. For _X_Y_P_i_x_m_a_p and _Z_P_i_x_m_a_p, the depth of the image must match the depth of the drawable, or a _B_a_d_M_a_t_c_h error results.

If the characteristics of the image (for example, byte_order and bitmap_unit) differ from what the server requires, _X_P_u_t_I_m_a_g_e automatically makes the appropriate conversions.

This function uses these GC components: function, plane-mask, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask. It also uses these GC mode-dependent components: foreground and background.

_X_P_u_t_I_m_a_g_e can generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_G_C, _B_a_d_M_a_t_c_h, and _B_a_d_V_a_l_u_e errors.

The _X_G_e_t_I_m_a_g_e function returns a pointer to an _X_I_m_a_g_e structure. This structure provides you with the contents of the specified rectangle of the drawable in the format you specify. If the format argument is _X_Y_P_i_x_m_a_p, the image contains only the bit planes you passed to the plane_mask argument. If the plane_mask argument only requests a subset of the planes of the display, the depth of the returned image will be the number of planes requested. If the format argument is _Z_P_i_x_m_a_p, _X_G_e_t_I_m_a_g_e returns as zero the bits in all planes not specified in the plane_mask argument. The function performs no range checking on the values in plane_mask and ignores extraneous bits.

_X_G_e_t_I_m_a_g_e returns the depth of the image to the depth member of the _X_I_m_a_g_e structure. The depth of the image is as specified when the drawable was created, except when getting a subset of the planes in _X_Y_P_i_x_m_a_p format, when the depth is given by the number of bits set to 1 in plane_mask.

If the drawable is a pixmap, the given rectangle must be wholly contained within the pixmap, or a _B_a_d_M_a_t_c_h error results. If the drawable is a window, the window must be viewable, and it must be the case that if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen and wholly contained within the outside edges of the window, or a _B_a_d_M_a_t_c_h error results. Note that the borders of the window can be included and read with this request. If the window has backing-store, the backing-store contents are returned for regions of the window that are obscured by noninferior windows. If the window does not have backing-store, the returned contents of such obscured regions are undefined. The returned contents of visible regions of inferiors of a different depth than the specified window's depth are also undefined. The pointer cursor image is not included in the returned contents. If a problem occurs, _X_G_e_t_I_m_a_g_e returns NULL.

_X_G_e_t_I_m_a_g_e can generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_M_a_t_c_h, and _B_a_d_V_a_l_u_e errors.

The _X_G_e_t_S_u_b_I_m_a_g_e function updates dest_image with the specified subimage in the same manner as _X_G_e_t_I_m_a_g_e. If the format argument is _X_Y_P_i_x_m_a_p, the image contains only the bit planes you passed to the plane_mask argument. If the format argument is _Z_P_i_x_m_a_p, _X_G_e_t_S_u_b_I_m_a_g_e returns as zero the bits in all planes not specified in the plane_mask argument. The function performs no range checking on the values in plane_mask and ignores extraneous bits. As a convenience, _X_G_e_t_S_u_b_I_m_a_g_e returns a pointer to the same _X_I_m_a_g_e structure specified by dest_image.

The depth of the destination _X_I_m_a_g_e structure must be the same as that of the drawable. If the specified subimage does not fit at the specified location on the destination image, the right and bottom edges are clipped. If the drawable is a pixmap, the given rectangle must be wholly contained within the pixmap, or a _B_a_d_M_a_t_c_h error results. If the drawable is a window, the window must be viewable, and it must be the case that if there were no inferiors or overlapping windows, the specified rectangle of the window would be fully visible on the screen and wholly contained within the outside edges of the window, or a _B_a_d_M_a_t_c_h error results. If the window has backing-store, then the backing-store contents are returned for regions of the window that are obscured by noninferior windows. If the window does not have backing-store, the returned contents of such obscured regions are undefined. The returned contents of visible regions of inferiors of a different depth than the specified window's depth are also undefined. If a problem occurs, _X_G_e_t_S_u_b_I_m_a_g_e returns NULL.

_X_G_e_t_S_u_b_I_m_a_g_e can generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_G_C, _B_a_d_M_a_t_c_h, and _B_a_d_V_a_l_u_e errors.

DIAGNOSTICS

_B_a_d_D_r_a_w_a_b_l_e
A value for a Drawable argument does not name a defined Window or Pixmap.
_B_a_d_G_C
A value for a GContext argument does not name a defined GContext.
_B_a_d_M_a_t_c_h
An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
_B_a_d_M_a_t_c_h
Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.
_B_a_d_V_a_l_u_e
Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.

SEE ALSO

_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e