git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20208
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- image.LoadFile( dir + _T("test.png") );
- my_square = new wxBitmap( image );
+ if ( image.LoadFile( dir + _T("test.png") ) )
+ my_square = new wxBitmap( image );
// test image loading from stream
wxFile file(dir + _T("horse.bmp"));
// test image loading from stream
wxFile file(dir + _T("horse.bmp"));
- off_t len = file.Length();
- void *data = malloc(len);
- if ( file.Read(data, len) != len )
- wxLogError(_T("Reading bitmap file failed"));
- else
- wxMemoryInputStream mis(data, len);
- if ( !image.LoadFile(mis) )
- wxLogError(wxT("Can't load BMP image from stream"));
+ off_t len = file.Length();
+ void *data = malloc(len);
+ if ( file.Read(data, len) != len )
+ wxLogError(_T("Reading bitmap file failed"));
- my_horse_bmp2 = new wxBitmap( image );
- }
+ {
+ wxMemoryInputStream mis(data, len);
+ if ( !image.LoadFile(mis) )
+ wxLogError(wxT("Can't load BMP image from stream"));
+ else
+ my_horse_bmp2 = new wxBitmap( image );
+ }