A couple of changes to wxImage:

1. changed wxBMP_foo, wxCUR_foo to wxIMAGE_OPTION_{BMP,CUR}_foo
   (with backward compatiblity macros, of course)
2. applied Chris' patch to update hotspot when scaling an image
3. applied Chris' patch to write a filename in XPM and generalized it
   to pass wxIMAGE_OPTION_FILENAME to all saving handlers


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-02-16 01:45:30 +00:00
parent 06534aa178
commit fd94e8aa45
7 changed files with 67 additions and 33 deletions

View File

@@ -151,7 +151,7 @@ public:
return;
}
image.SetOption(wxBMP_FORMAT, bppvalues[bppselection]);
image.SetOption(wxIMAGE_OPTION_BMP_FORMAT, bppvalues[bppselection]);
wxString deffilename = bppchoices[bppselection];
deffilename.Replace(wxT(" "), wxT("_"));
@@ -173,7 +173,7 @@ public:
if ( savefilename.empty() )
return;
if ( image.GetOptionInt(wxBMP_FORMAT) == wxBMP_8BPP_PALETTE )
if ( image.GetOptionInt(wxIMAGE_OPTION_BMP_FORMAT) == wxBMP_8BPP_PALETTE )
{
unsigned char *cmap = new unsigned char [256];
for ( int i = 0; i < 256; i++ )
@@ -204,8 +204,8 @@ public:
else if (extension == "cur")
{
image.Rescale(32,32);
image.SetOption(wxCUR_HOTSPOT_X, 0);
image.SetOption(wxCUR_HOTSPOT_Y, 0);
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 0);
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, 0);
saved=image.SaveFile(savefilename, wxBITMAP_TYPE_CUR);
}
else
@@ -415,8 +415,8 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
else
{
my_horse_cur = new wxBitmap( image );
xH = 30 + image.GetOptionInt(wxCUR_HOTSPOT_X) ;
yH = 2420 + image.GetOptionInt(wxCUR_HOTSPOT_Y) ;
xH = 30 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) ;
yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ;
}
#endif