1XpmCreateXpmImage(3) libXpm functions XpmCreateXpmImage(3)
2
3
4
6 XpmCreateXpmImage - create an Xpm image
7
9 int XpmCreateXpmImageFromData(char **data, XpmImage *image,
10 XpmInfo *info);
11
12 int XpmCreateXpmImageFromBuffer(char *buffer, XpmImage *image,
13 XpmInfo *info);
14
15 int XpmCreateXpmImageFromImage(Display *display,
16 XImage *image, XImage *shapeimage,
17 XpmImage *xpmimage, XpmAttributes *attributes);
18
19 int XpmCreateXpmImageFromPixmap(Display *display,
20 Pixmap *pixmap, Pixmap *shapemask,
21 XpmImage *xpmimage, XpmAttributes *attributes);
22
23
25 data Specifies the location of the data.
26
27 image Specifies the image structure location.
28
29 info Specifies the location of an XpmInfo structure to get and store
30 information (or NULL).
31
32 display
33 Specifies the connection to the X server.
34
35 image Specifies the X image used as the source.
36
37 shapeimage
38 Specifies the shape mask image, if any.
39
40 xpmimage
41 Specifies the XPM image which is created.
42
43 attributes
44 Specifies the location of a structure containing information (or
45 NULL).
46
47
49 XpmCreateXpmImageFromBuffer
50 To create an XpmImage from an XPM buffer, use XpmCreateXpmImageFrom‐
51 Buffer(). The XpmCreateXpmImageFromBuffer() function reads the given
52 buffer to fill in the given XpmImage structure. If the buffer does not
53 contain valid XPM data, it returns XpmFileInvalid. If insufficient
54 working storage is allocated, it returns XpmNoMemory. On success it
55 returns XpmSuccess. If the passed XpmInfo structure pointer is not
56 NULL, XpmCreateXpmImageFromBuffer() looks for the following attributes:
57 XpmReturnComments and XpmReturnExtensions, and sets possibly the
58 XpmHotspot attribute when returning. As specified in the table (page
59 28), if the data related to the attributes XpmReturnComments and XpmRe‐
60 turnExtensions cannot be returned as requested because of insufficient
61 memory storage, XpmCreateXpmImageFromBuffer() will change the valuemask
62 to mention this and will try to continue. So the caller should check
63 on this before accessing requested data.
64
65 Note: The valuemask of the passed XpmInfo structure must be set to some
66 valid value, at least zero, otherwise unpredictable errors can occur.
67
68
69 XpmCreateXpmImageFromData
70 To create an XpmImage from an XPM data, use XpmCreateXpmImageFrom‐
71 Data(). XpmCreateXpmImageFromData() fills in the given XpmImage struc‐
72 ture from the given data. If the data does not contain valid XPM data,
73 it returns XpmFileInvalid. If insufficient working storage is allo‐
74 cated, it returns XpmNoMemory. On success it returns XpmSuccess. If
75 the passed XpmInfo structure pointer is not NULL, XpmCreateXpmImage‐
76 FromData() looks for the following attributes: XpmReturnExtensions, and
77 sets possibly the XpmHotspot attribute when returning. As specified in
78 the table (page 28), if the data related to the attribute XpmReturnEx‐
79 tensions cannot be returned as requested because of insufficient memory
80 storage, XpmCreateXpmImageFromData() will change the valuemask to men‐
81 tion this and will try to continue. So the caller should check on this
82 before accessing requested data.
83
84 Note: The valuemask of the passed XpmInfo structure must be set to some
85 valid value, at least zero, otherwise unpredictable errors can occur.
86
87
88 XpmCreateXpmImageFromImage
89 To create an XpmImage from an XImage, use XpmCreateXpmImageFromImage().
90 From the given X images and XpmAttributes if not NULL, XpmCreateXpmIm‐
91 ageFromImage() creates an XpmImage following the same mechanism as
92 XpmWriteFileFromImage(3).
93
94
95 XpmCreateXpmImageFromPixmap
96 To create an XpmImage from a Pixmap, use XpmCreateXpmImageFromPixmap().
97 From the given pixmaps and XpmAttributes if not NULL, XpmCreateXpmIm‐
98 ageFromPixmap() gets the related XImages by calling XGetImage, then it
99 gives them to XpmCreateXpmImageFromImage() to create an XpmImage which
100 is returned to xpmimage. Finally it destroys the created X images us‐
101 ing XDestroyImage(3).
102
103
104
106 XpmFreeXpmImage(3), XpmReadFileToBuffer(3), XpmReadFileToData(3),
107 XpmReadFileToImage(3), XpmReadFileToPixmap(3), XpmWriteFileFromImage(3)
108
109
110
111X Version 11 libXpm 3.5.17 XpmCreateXpmImage(3)