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

FreeBSD Manual Pages

  
 
  

home | help
XmtCreateP...romXmtImage(3) Library Functions Manual XmtCreateP...romXmtImage(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 displayed.
		 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  colormap  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 specified,
		 the default depth of the default screen of the display of  wid-
		 get will be used.

	  colors An  XmtColorTable used to look up any symbolic colors specified
		 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 XImage.

     OUTPUTS

	  image_return
		 The address at which the pixmap or XImage version  of	xmtimage
		 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 allocated
		 array of the Pixel values that were allocated for the pixmap or
		 XImage will be stored.  You may specify NULL if you are not in-
		 terested  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	elements
		 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  other-
	  wise.

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 ad-
     dress 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 con-
     version fails, these functions return False.

     An XmtImage structure is the processed form of an XPM file or XPM data  re-
     turned  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 XmtColorTable colors. The XPM image for-
     mat  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_pixels_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 deallocate those pixels when
     the pixmap is no longer needed. Note that the array of Pixel values is  al-
     located  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  im-
     age_return  and mask_return should be freed with XFreePixmap() or XDestroy-
     Image().

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

Xmt				   Motif Tools	     XmtCreateP...romXmtImage(3)

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

home | help