wxImage::saveFile errors 2.9.1 , mathplot.cpp  [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.
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

Postby tedzini » Sat Oct 16, 2010 4:36 pm

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: 12816
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Postby doublemax » Sat Oct 16, 2010 6:03 pm

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

  [SOLVED]

Postby tedzini » Sun Oct 17, 2010 9:00 pm

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

grrrr. ](*,)

t


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 23 guests