wxImage::saveFile errors 2.9.1 , mathplot.cpp Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
tedzini
Knows some wx things
Knows some wx things
Posts: 34
Joined: Tue Apr 20, 2010 2:30 pm

wxImage::saveFile errors 2.9.1 , mathplot.cpp

Post by tedzini »

Greetings,

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.

thanks,
T
([email protected])
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax »

In 2.9.x the "type" parameter is not an int any more, it's a new type "wxBitmapType"
http://docs.wxwidgets.org/trunk/classwx ... 431e7044d4

Use a cast or - even better - change the type parameter at all occurrences.
Use the source, Luke!
tedzini
Knows some wx things
Knows some wx things
Posts: 34
Joined: Tue Apr 20, 2010 2:30 pm

Post by tedzini »

OK, that fixed it thanks! -- I'm still getting used to MSVS, the compilation error statements are a bit misleading.

grrrr. ](*,)

t
Post Reply