News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to add image file to Builds, or setting image path for deployment exe.

Started by Aaron, March 21, 2015, 09:55:11 PM

Previous topic - Next topic

Aaron

I'm learning CB 13.12 (with wxWidgets 3.0.2 and MinGW on windows) and trying to find out how to add a small logo image for example to a project.
The CB manual doesn't answer this that I could find.  No old posts found.

As is, the app is looking in the path of image file in Code Blocks project folder. So when the app is run on a foreign PC there is an error when the image files are not found.

What is a recommended method.  The Bitmap file properties will not allow user to over write browsed file location.

any ideas welcomed. 

Aaron

I figured it out.

I edited the StaticBitmap1 line in my Main.cpp to the image file path of the deployed exe file, removing the long path. ( now same dir as EXE)

StaticBitmap1 = new wxStaticBitmap(Panel1, ID_STATICBITMAP1, wxBitmap(wxImage(_T("Logo1.bmp"))), wxPoint(16,360), wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1"));

There is probably a more correct solution using CB IDE features.