| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. How to include ICONS and BITMAPS in your application #2812 | I have few icons and bitmaps that I need to include in my executable so that I have not to package them with program. My understanding is that the portable way is XRC. Is there a simple sample of XRC just for such resourcesw (no dialogs or menus, just icons and bitmaps).
TIA
DdJ | 2. Re: How to include ICONS and BITMAPS in your application #2815 Posted by: upCASE 2003-10-31 02:17:18 | XRC is a resource system that is designed for things like loading dialogs at runtime and storing layouts, not only saving icons and stuff. An XRC file is a seperate XML file storing the layout that can be loaded at runtime. It doesn't store the images in it, they stay seperate. XRS files can store images and other resources, but they're more like zip files... XRC should be protable, but I confess I never used it. It's still not a "real" part of wxWindows and stays in the contrib.
You could convert your images to the xpm format, include them in your source and use the correct ctor to get a bitmap or icon. Like: #include "myicon.xpm" ... wxIcon* myIcon = new wxIcon(myicon); or wxIcon* myIcon = new wxIcon(myicon, wxBITMAP_TYPE_XPM );
Since XPM is a plaintext format you can use it on every platform. It's even easier to use when you need masked region. Then you don't have to use wxMask...
BTW: For a simple example of XRC, check the contrib dir...
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 3. Re: How to include ICONS and BITMAPS in your application #2828 Posted by: 2003-11-02 04:00:27 | Thank you. I think I could use XPM. But how can I convert a bitmap or GIF to XPM? Does XMP support transparency? | 4. Re: How to include ICONS and BITMAPS in your application #2836 Posted by: upCASE 2003-11-02 21:03:31 | Hi! Yes, it does. Simply open it up in a text editor and set all color codes you want to be transparent to color "none". For bitmaps there's a tool called "bmp2xpm". Search the wxWindows site. I think Gimp and maybe a prog like Corel can handle XPM.
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 5. Re: How to include ICONS and BITMAPS in your application #2840 Posted by: 2003-11-02 23:14:30 | OK, I found a way. I can use PaintShop Pro to export any image I like to a XPM file. Then I have to edit file and change the color I wish as transparent to None (PSP does not support that yet). At last, I have to change structure name, since PSP always use Pixmate.
Thank you, upcase.
DdJ
| 6. Re: How to include ICONS and BITMAPS in your application #2844 Posted by: upCASE 2003-11-03 04:47:50 | Hi!
Your welcome!
Oh yes, I forgot to tell you about the array name.... Glad you found it yourself, because I spend about an hour on that when first trying it :)
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|