|
I'm trying to load an image using the real path and filename of the file. I'm using wxFileDialog to get the filename and path, I'm using iLoader::LoadImage to load the image. The error I'm getting is the file does not exist on VFS. I looked at viewmesh's source code to get the basic outline of code.
Here's is the code I'm using:
wxFileDialog dialog(this, caption, default_dir, default_filename, wildcard, wxOPEN | wxFILE_MUST_EXIST); if(dialog.ShowModal() == wxID_OK) { vfs->Mount("/tmp/avocado", dialog.GetDirectory().c_str()); vfs->ChDir("/tmp/avocado"); vfs->PushDir();
csRef<iImage> hm_img = loader->LoadImage(dialog.GetFilename().c_str(), CS_IMGFMT_TRUECOLOR); if(hm_img == 0) { // error handling }
// do stuff with image
vfs->PopDir(); hm_img = 0;
}
CS version: svn as of aug 25, 2006 OS: linux
Thanks for any help, Jonathan
|