]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | README.MSW hedu@cul-ipn.uni-kiel.de 5/94 | |
3 | ||
4 | The XPM library for MS-Windows | |
5 | ||
6 | Motivated by the wxWindows library, which is a (freely available) toolkit | |
7 | for developing multi-platform, graphical applications from the same body | |
8 | of C++ code,I wanted to have XPM pixmaps for MS-windows. Instead of rewriting | |
9 | a XPM-parser I managed to port the XPM-library-code to MS-windows. | |
10 | Thanks to Anaud Le Hors this became a part of the official XPM-library. | |
11 | ||
12 | Until now it's only used together with wxWindows. And even there it's more | |
13 | a kind of beta. But it should be possible to run it as a simple libxpm.a | |
14 | without wxWindows. | |
15 | ||
16 | The key is a transformation of some X types plus some basic X functions. | |
17 | There is not yet a special MSW-API, so you should know the X types used. | |
18 | ||
19 | The following is done in simx.h: | |
20 | ||
21 | typedef HDC Display; | |
22 | typedef COLORREF Pixel; | |
23 | ||
24 | typedef struct { | |
25 | Pixel pixel; | |
26 | BYTE red, green, blue; | |
27 | } XColor; | |
28 | ||
29 | typedef struct { | |
30 | HBITMAP bitmap; | |
31 | unsigned int width; | |
32 | unsigned int height; | |
33 | unsigned int depth; | |
34 | } XImage; | |
35 | ||
36 | With these defines and the according functions from simx.c you can call | |
37 | XPM-functions the way it's done under X windows. It can look like this: | |
38 | ||
39 | ErrorStatus=XpmCreateImageFromData(&dc, data, | |
40 | &ximage,(XImage **)NULL, &xpmAttr); | |
41 | ms_bitmap = ximage->bitmap; | |
42 | // releases the malloc,but do not destroy the bitmap | |
43 | XImageFree(ximage); | |
44 | ||
45 | Supported functions are the Xpm*Image* but not the Xpm*Pixmap*. | |
46 | ||
47 | DRAWBACKS: | |
48 | The main drawback is the missing support for Colormaps! There was nothing for | |
49 | it in wxWindows, so I did not know how to deal with Colormaps. | |
50 | ||
51 | The size of the pixmaps is bounded by malloc() (width*height*2 < 64K). | |
52 | ||
53 | Close colors do not look that close. But that seems to be the window system. | |
54 | ||
55 | Neither a special API for MSW nor a special MSW documentation other than this. | |
56 | (I can only point you to wxxpm as an example , see below.) | |
57 | ||
58 | INSTALLATION: | |
59 | There is not yet a makefile with it. Simply take all the *.c files | |
60 | into your project. | |
61 | !!!You MUST set FOR_MSW on the preprocessor options!!! | |
62 | (You might uncomment NEED_STRCASECMP in xpm.h if it's in your lib) | |
63 | This should compile into libxpm.a. Good luck... | |
64 | ||
65 | FTP: | |
66 | wxWindows is currently available from the Artificial Intelligence | |
67 | Applications Institute (University of Edinburgh) by anonymous FTP. | |
68 | skye.aiai.ed.ac.uk pub/wxwin/ | |
69 | or read http://burray.aiai.ed.ac.uk/aiai/aiai.html | |
70 | ||
71 | wxxpm, XPM support for wxWindows, the latest version is available at | |
72 | yoda.cul-ipn.uni-kiel.de pub/wxxpm/ | |
73 | and maybe in the contrib or tools of wxWindows | |
74 | ||
75 | Please contact me if you have suggestions, comments or problems! | |
76 | ||
77 | -- | |
78 | ////|\\\\ \\\\\\ Hermann Dunkel | |
79 | O O ////// IPN Uni Kiel, Germany | |
80 | | \\\\\\ Tel: +49 431 / 880 3144 | |
81 | \___/ ////// E-mail: hedu@cul-ipn.uni-kiel.de | |
82 | \_/ \\\\\\ X.400 : c=de;a=d400;p=uni-kiel;ou=nw-didaktik;s=dunkel | |
83 |