I'm using wxAnimationCtrl in my application to load gif file. Currently I'm providing the full path to the gif file location. It works fine in my system but when I'm running executable in some other system I'm receiving an error stating gif file not found.
How should I load gif file in my application, such that it is automatically loaded in all systems.
I also tried converting gif file to xpm format and now 20 .xpm files are generated for each frame. I don't know how to load all to .xpm files and show animation frame by frame.
Load Gif file from the current location
Re: Load Gif file from the current location
Use one of the paths returned by wxStandardPaths and use it to build an absolute path:
https://docs.wxwidgets.org/trunk/classw ... paths.html
E.g. you can get the directory the executable lies in with:
https://docs.wxwidgets.org/trunk/classw ... paths.html
E.g. you can get the directory the executable lies in with:
Code: Select all
#include <wx/stdpaths.h>
#include <wx/filename.h>
wxString exeDir = wxStandardPaths::Get().GetExecutablePath().BeforeLast( wxFileName::GetPathSeparator() );
wxLogMessage("exe dir: %s", exeDir);
Use the source, Luke!