+ m_bmpSmileXpm.SaveFile(_T("saved.xpm"), wxBITMAP_TYPE_XPM);
+
+#if wxUSE_ICO_CUR
+ image.Destroy();
+
+ if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
+ wxLogError(wxT("Can't load first ICO image"));
+ else
+ my_horse_ico32 = new wxBitmap( image );
+
+ image.Destroy();
+
+ if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
+ wxLogError(wxT("Can't load second ICO image"));
+ else
+ my_horse_ico16 = new wxBitmap( image );
+
+ image.Destroy();
+
+ if ( !image.LoadFile( dir + _T("horse.ico") ) )
+ wxLogError(wxT("Can't load best ICO image"));
+ else
+ my_horse_ico = new wxBitmap( image );
+
+ image.Destroy();
+
+ if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) )
+ wxLogError(wxT("Can't load best ICO image"));
+ else
+ {
+ my_horse_cur = new wxBitmap( image );
+ xH = 30 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) ;
+ yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ;
+ }
+
+ m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI );
+ if (m_ani_images==0)
+ wxLogError(wxT("No ANI-format images found"));
+ else
+ my_horse_ani = new wxBitmap [m_ani_images];
+ int i ;
+ for (i=0; i < m_ani_images; i++)
+ {
+ image.Destroy();
+ if (!image.LoadFile( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI, i ))
+ {
+ wxString tmp = wxT("Can't load image number ");
+ tmp << i ;
+ wxLogError(tmp);
+ }
+ else
+ my_horse_ani [i] = wxBitmap( image );
+ }
+#endif // wxUSE_ICO_CUR
+
+ image.Destroy();
+
+ // test image loading from stream
+ wxFile file(dir + _T("horse.bmp"));
+ if ( file.IsOpened() )
+ {
+ wxFileOffset len = file.Length();
+ size_t dataSize = (size_t)len;
+ void *data = malloc(dataSize);
+ if ( file.Read(data, dataSize) != len )
+ wxLogError(_T("Reading bitmap file failed"));
+ else
+ {
+ wxMemoryInputStream mis(data, dataSize);
+ if ( !image.LoadFile(mis) )
+ wxLogError(wxT("Can't load BMP image from stream"));
+ else
+ my_horse_bmp2 = new wxBitmap( image );
+ }
+
+ free(data);
+ }