Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
XmtCreatePixmapFromXmtImageLibrary Functions ManXmtCreatePixmapFromXmtImage(3)

NAME
       XmtCreatePixmapFromXmtImage(), XmtCreateXImageFromXmtImage() - create a
       pixmap or XImage	from an	XmtImage.

SYNOPSIS
       #include	<Xmt/Xpm.h>

       Boolean XmtCreatePixmapFromXmtImage(Widget widget, Drawable win,	Visual
		      *visual, Colormap	cmap, unsigned int depth,
		      XmtColorTable colors, XmtImage *xmtimage,	Pixmap
		      *image_return, Pixmap *mask_return, Pixel
		      **allocated_pixels_return, int
		      *num_allocated_pixels_return)

       Boolean XmtCreateXImageFromXmtImage(Widget widget, Visual *visual,
		      Colormap cmap, unsigned int depth, XmtColorTable colors,
		      XmtImage *xmtimage, XImage **image_return, XImage
		      **mask_return, Pixel **allocated_pixels_return, int
		      *num_allocated_pixels_return)

ARGUMENTS
       INPUTS

	    widget Any	widget	in the application. Specifies the dis play and
		   screen for which the	pixmap or XImage is to be created.

	    win	   For	XmtCreatePixmapFromXmtImage()  only,  any  Window   or
		   Pixmap  on the same screen that the pixmap is to be created
		   on.

	    visual The Visual for which	the pixmap or XImage  is  to  be  dis-
		   played.  If	NULL  is  specified, the default Visual	of the
		   default screen of the display of widget will	be used.

	    cmap   The colormap	in which colors	 will  be  allocated  for  the
		   pixmap  or  XImage.	If None	is specified, the default col-
		   ormap of the	default	screen of the display of  widget  will
		   be used.

	    depth  The	depth  of  the or XImage to be created.	If 0 is	speci-
		   fied, the default depth of the default screen of  the  dis-
		   play	of widget will be used.

	    colors An XmtColorTable used to look up any	symbolic colors	speci-
		   fied	in the XmtImage. If NULL is  specified,	 any  symbolic
		   colors will be ignored.

	    xmtimage
		   The XmtImage	that is	to be instantiated as a	pixmap or XIm-
		   age.

       OUTPUTS

	    image_return
		   The address at which	the pixmap or XImage version of	xmtim-
		   age will be returned.

	    mask_return
		   The address at which	the bitmask, if	any, for xmtimage will
		   be returned,	as a pixmap or XImage.	You may	 specify  NULL
		   if you are not interested in	mask data for the XmtImage.

	    allocated_pixels_return
		   The address of a variable of	type Pixel * at	which an allo-
		   cated array of the Pixel values that	were allocated for the
		   pixmap  or  XImage will be stored.  You may specify NULL if
		   you are not interested in this return value.	This  returned
		   array  must	be  freed  with	 XtFree() when it is no	longer
		   needed.

	    num_allocated_pixels_return
		   The address of an int variable in which the number of  ele-
		   ments   of	the   allocated_pixels_return  array  will  be
		   returned, or	NULL if	you are	not interested in this value.

       RETURNS

	    True if the	pixmap or XImage was created successfully, False  oth-
	    erwise.

DESCRIPTION
       XmtCreatePixmapFromXmtImage() and XmtCreateXImageFromXmtImage() convert
       an XmtImage to a	Pixmap and to an XImage,  using	 the  display  of  the
       specified  widget, and the specified visual, colormap, depth, and table
       of symbolic colors. If successful, these	functions store	the  converted
       image  at  the  address specified by image_return and return True. They
       may also	return a bitmask for the image at  the	address	 specified  by
       mask_return. If the conversion fails, these functions return False.

       An  XmtImage structure is the processed form of an XPM file or XPM data
       returned	by XmtParseXpmFile() and XmtParseXpmData().   The  XPM	format
       allows  different color specifications for different visual types, so a
       that when an XmtImage is	converted for a	color screen it	 might	use  a
       different  color	 scheme	 than  it would	when converted for a grayscale
       screen. The XPM image format and	XmtImage  structure  support  symbolic
       color names which are looked up during the conversion using the XmtCol-
       orTable colors. The XPM image format and	the  XmtImage  structure  also
       support	 the   special	 ``transparent''   color  named	 ``None''.  If
       mask_return is non-NULL,	 and  if  the  image  contains	any  of	 these
       ``transparent''	bits, then this	function will also create and return a
       ``bitmask'' for the image-a single-plane	pixmap or XImage that has bits
       set for non-transparent pixels and cleared for transparent pixels.

       In  order  to  convert an XmtImage to a pixmap or XImage, this function
       must allocate colors. If	allocated_pixels_return	and num_allocated_pix-
       els_return  are	not NULL, then they will be filled in with an array of
       the Pixel values	that were allocated during the conversion, and a count
       of  the elements	in that	array. This information	can be used to deallo-
       cate those pixels when the pixmap is no longer needed.  Note  that  the
       array  of  Pixel	 values	 is allocated memory, and should be freed with
       XtFree()	once the Pixel values have been	released.

       When they are no	longer needed, the  pixmaps  or	 XImages  returned  in
       image_return and	mask_return should be freed with XFreePixmap() or XDe-
       stroyImage().

SEE ALSO
       Chapter 5, Using	Icons,
       Chapter 4, Using	Color,
       XmtGetPixmap(), XmtLookupPixmap(), XmtParseXpmData(),
       XmtParseXpmFile().

Xmt				  Motif	Tools	XmtCreatePixmapFromXmtImage(3)

NAME | SYNOPSIS | ARGUMENTS | DESCRIPTION | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=XmtCreatePixmapFromXmtImage&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help