GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XMTCREATEPIXMAPFROMXMTIMAGE (3)

NAME

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

CONTENTS

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 widget 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 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 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 otherwise.

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 XmtColorTable 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_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 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 XDestroyImage().

SEE ALSO

Chapter 5, Using Icons,
Chapter 4, Using Color,
XmtGetPixmap(), XmtLookupPixmap(), XmtParseXpmData(), XmtParseXpmFile().
Search for    or go to Top of page |  Section 3 |  Main Index


Xmt XMTCREATEPIXMAPFROMXMTIMAGE (3) Motif Tools

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.