xpm bitmap on mac os

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
rkubrick
Earned a small fee
Earned a small fee
Posts: 17
Joined: Sat Aug 30, 2008 12:29 am

xpm bitmap on mac os

Post by rkubrick »

I can't load an xpm icon into a bitmap on Mac:

Code: Select all

 wxBitmap bitmap(wxBITMAP(MyIcon));
  if( bitmap.Ok() ) {
    wxSplashScreen* pSplash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 
                                                 10000, this, wxID_ANY, wxDefaultPosition, wxSize(500, 500), 
                                                 wxSIMPLE_BORDER|wxSTAY_ON_TOP);
    wxGetApp().Yield();
  } else
    _pAboutDialog->Show(true);
bitmap.Ok() always returns false. The code compiles fine.
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

What is 'MyIcon' ?
Did you try with another format (e.g. png) then does it work?
rkubrick
Earned a small fee
Earned a small fee
Posts: 17
Joined: Sat Aug 30, 2008 12:29 am

Post by rkubrick »

I'd like to use the XPM format because it stores the icon in memory and I don't need to carry around a file when I dist the application.
Sof_T
Can't get richer than this
Can't get richer than this
Posts: 864
Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:

Post by Sof_T »

You can embed PNGs in your source code using bin2c. It gives you the same advantages as XPMs but nicer looking images.

Sof.T
The home of Sof.T http://www.sof-t.site88.net/
Author of Programming with wxDevC++
http://sourceforge.net/projects/wxdevcpp-book/
Post Reply