Page 1 of 1

wxImage::saveFile errors 2.9.1 , mathplot.cpp

Posted: Sat Oct 16, 2010 4:36 pm
by tedzini

I've been using mathplot.cpp under 2.8.3 for winXP and now I'm trying to recompile it with 2.9.1.

The VSC9 compilation fails with:

1>.\mathplot.cpp(2255) : error C2248: 'wxString::wxString' : cannot access private member declared in class 'wxString'

for the method:

bool mpWindow::SaveScreenshot(const wxString& filename, int type, wxSize imageSize, bool fit)

and the line specifically involves the .saveFile method for a wxImage object:

wxImage screenImage = screenBuffer.ConvertToImage();
return screenImage.SaveFile(filename, type); // error here

Any help/guidance for resolution would be greatly appreciated.

([email protected])

Posted: Sat Oct 16, 2010 6:03 pm
by doublemax
In 2.9.x the "type" parameter is not an int any more, it's a new type "wxBitmapType" ... 431e7044d4

Use a cast or - even better - change the type parameter at all occurrences.

Posted: Sun Oct 17, 2010 9:00 pm
by tedzini
OK, that fixed it thanks! -- I'm still getting used to MSVS, the compilation error statements are a bit misleading.

grrrr. ](*,)