Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Aaron on March 21, 2015, 09:55:11 pm

Title: How to add image file to Builds, or setting image path for deployment exe.
Post by: Aaron on March 21, 2015, 09:55:11 pm
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. 
Title: Re: How to add image file to Builds, or setting appPath for an included image.
Post by: Aaron on March 21, 2015, 11:17:27 pm
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)

Code
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.