X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3fcfa4d89d44425ed28050462c6064100fe7b05..ef0898052549fc7d1c71b1165dafef42c9735cdf:/src/msw/statbmp.cpp diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 14adf39e01..a584ebac96 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -167,6 +167,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, // no need to delete the new image SetImageNoCopy(image); + // GetBestSize will work properly now, so set the best size if needed + SetBestSize(size); + return TRUE; } @@ -201,6 +204,15 @@ void wxStaticBitmap::Free() m_image = NULL; } +wxSize wxStaticBitmap::DoGetBestSize() const +{ + if ( ImageIsOk() ) + return wxSize(m_image->GetWidth(), m_image->GetHeight()); + + // this is completely arbitrary + return wxSize(16, 16); +} + void wxStaticBitmap::SetImage( const wxGDIImage* image ) { wxGDIImage* convertedImage = ConvertImage( *image );