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.
rkubrick
Earned a small fee
Posts: 17 Joined: Sat Aug 30, 2008 12:29 am
Post
by rkubrick » Tue Sep 23, 2008 5:21 am
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
Posts: 6695 Joined: Thu Sep 28, 2006 12:23 am
Contact:
Post
by Auria » Tue Sep 23, 2008 2:50 pm
What is 'MyIcon' ?
Did you try with another format (e.g. png) then does it work?
rkubrick
Earned a small fee
Posts: 17 Joined: Sat Aug 30, 2008 12:29 am
Post
by rkubrick » Wed Sep 24, 2008 11:49 am
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
Posts: 864 Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:
Post
by Sof_T » Thu Sep 25, 2008 9:51 pm
You can embed PNGs in your source code using bin2c. It gives you the same advantages as XPMs but nicer looking images.
Sof.T