Author Topic: How to add image file to Builds, or setting image path for deployment exe.  (Read 4814 times)

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
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. 
« Last Edit: March 22, 2015, 12:06:29 am by taSteve »

Offline Aaron

  • Multiple posting newcomer
  • *
  • Posts: 59
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.