


XCreateImage(3X11)					   XCreateImage(3X11)
X11R5									X11R5



NAME
  XCreateImage,	XGetPixel, XPutPixel, XSubImage, XAddPixel, XDestroyImage -
  image	utilities

SYNTAX
  XImage *XCreateImage(_d_i_s_p_l_a_y,	_v_i_s_u_a_l,	_d_e_p_t_h, _f_o_r_m_a_t, _o_f_f_s_e_t, _d_a_t_a, _w_i_d_t_h,
  _h_e_i_g_h_t, _b_i_t_m_a_p__p_a_d,
			  _b_y_t_e_s__p_e_r__l_i_n_e)
	Display	*_d_i_s_p_l_a_y;
	Visual *_v_i_s_u_a_l;
	unsigned int _d_e_p_t_h;
	int _f_o_r_m_a_t;
	int _o_f_f_s_e_t;
	char *_d_a_t_a;
	unsigned int _w_i_d_t_h;
	unsigned int _h_e_i_g_h_t;
	int _b_i_t_m_a_p__p_a_d;
	int _b_y_t_e_s__p_e_r__l_i_n_e;

  unsigned long	XGetPixel(_x_i_m_a_g_e, _x, _y)
	XImage *_x_i_m_a_g_e;
	int _x;
	int _y;

  XPutPixel(_x_i_m_a_g_e, _x, _y, _p_i_x_e_l)
	XImage *_x_i_m_a_g_e;
	int _x;
	int _y;
	unsigned long _p_i_x_e_l;

  XImage *XSubImage(_x_i_m_a_g_e, _x, _y, _s_u_b_i_m_a_g_e__w_i_d_t_h, _s_u_b_i_m_a_g_e__h_e_i_g_h_t)
	XImage *_x_i_m_a_g_e;
	int _x;
	int _y;
	unsigned int _s_u_b_i_m_a_g_e__w_i_d_t_h;
	unsigned int _s_u_b_i_m_a_g_e__h_e_i_g_h_t;

  XAddPixel(_x_i_m_a_g_e, _v_a_l_u_e)
	XImage *_x_i_m_a_g_e;
	long _v_a_l_u_e;

  XDestroyImage(_x_i_m_a_g_e)
	  XImage *_x_i_m_a_g_e;

ARGUMENTS

  _b_i_t_m_a_p__p_a_d
	    Specifies the quantum of a scanline	(8, 16,	or 32).	 In other
	    words, the start of	one scanline is	separated in client memory
	    from the start of the next scanline	by an integer multiple of
	    this many bits.

  _b_y_t_e_s__p_e_r__l_i_n_e
	    Specifies the number of bytes in the client	image between the
	    start of one scanline and the start	of the next.

  _d_a_t_a	    Specifies the image	data.

  _d_e_p_t_h	    Specifies the depth	of the image.

  _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_B_i_t_m_a_p,
	    _X_Y_P_i_x_m_a_p, or _Z_P_i_x_m_a_p.

  _h_e_i_g_h_t    Specifies the height of the	image, in pixels.

  _o_f_f_s_e_t    Specifies the number of pixels to ignore at	the beginning of the
	    scanline.

  _p_i_x_e_l	    Specifies the new pixel value.

  _s_u_b_i_m_a_g_e__h_e_i_g_h_t
	    Specifies the height of the	new subimage, in pixels.

  _s_u_b_i_m_a_g_e__w_i_d_t_h
	    Specifies the width	of the new subimage, in	pixels.

  _v_a_l_u_e	    Specifies the constant value that is to be added.

  _v_i_s_u_a_l    Specifies the _V_i_s_u_a_l structure.

  _w_i_d_t_h	    Specifies the width	of the image, in pixels.

  _x_i_m_a_g_e    Specifies the image.

  _x
  _y	    Specify the	x and y	coordinates.

DESCRIPTION
  The _X_C_r_e_a_t_e_I_m_a_g_e function allocates the memory needed	for an _X_I_m_a_g_e struc-
  ture for the specified display but does not allocate space for the image
  itself.  Rather, it initializes the structure	byte-order, bit-order, and
  bitmap-unit values from the display and returns a pointer to the _X_I_m_a_g_e
  structure.  The red, green, and blue mask values are defined for Z format
  images only and are derived from the _V_i_s_u_a_l structure	passed in.  Other
  values also are passed in.  The offset permits the rapid displaying of the
  image	without	requiring each scanline	to be shifted into position.  If you
  pass a zero value in bytes_per_line, Xlib assumes that the scanlines are
  contiguous in	memory and calculates the value	of bytes_per_line itself.

  Note that when the image is created using _X_C_r_e_a_t_e_I_m_a_g_e, _X_G_e_t_I_m_a_g_e, or	_X_S_u_-
  _b_I_m_a_g_e, the destroy procedure	that the _X_D_e_s_t_r_o_y_I_m_a_g_e function	calls frees
  both the image structure and the data	pointed	to by the image	structure.

  The basic functions used to get a pixel, set a pixel,	create a subimage,
  and add a constant value to an image are defined in the image	object.	 The
  functions in this section are	really macro invocations of the	functions in
  the image object and are defined in <_X_1_1/_X_u_t_i_l._h>.

  The _X_G_e_t_P_i_x_e_l	function returns the specified pixel from the named image.
  The pixel value is returned in normalized format (that is, the least-
  significant byte of the long is the least-significant	byte of	the pixel).
  The image must contain the x and y coordinates.

  The _X_P_u_t_P_i_x_e_l	function overwrites the	pixel in the named image with the
  specified pixel value.  The input pixel value	must be	in normalized format
  (that	is, the	least-significant byte of the long is the least-significant
  byte of the pixel).  The image must contain the x and	y coordinates.

  The _X_S_u_b_I_m_a_g_e	function creates a new image that is a subsection of an
  existing one.	 It allocates the memory necessary for the new _X_I_m_a_g_e struc-
  ture and returns a pointer to	the new	image.	The data is copied from	the
  source image,	and the	image must contain the rectangle defined by x, y,
  subimage_width, and subimage_height.

  The _X_A_d_d_P_i_x_e_l	function adds a	constant value to every	pixel in an image.
  It is	useful when you	have a base pixel value	from allocating	color
  resources and	need to	manipulate the image to	that form.

  The _X_D_e_s_t_r_o_y_I_m_a_g_e function deallocates the memory associated with the	_X_I_m_-
  _a_g_e structure.

SEE ALSO
  XPutImage(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e	delim off






















































