+#if wxUSE_IMAGE
+void BitmapComboBoxWidgetsPage::RescaleImage(wxImage& image, int w, int h)
+{
+ if ( image.GetWidth() == w && image.GetHeight() == h )
+ return;
+
+ if ( w <= 0 || h <= 0 )
+ return;
+
+ static bool isFirstScale = true;
+
+ if ( isFirstScale && m_combobox->GetCount() > 0 )
+ {
+ wxMessageBox( wxT("wxBitmapComboBox normally only supports images of one size. ")
+ wxT("However, for demonstration purposes, loaded bitmaps are scaled to fit ")
+ wxT("using wxImage::Rescale."),
+ wxT("Notice"),
+ wxOK,
+ this );
+
+ isFirstScale = false;
+ }
+
+ image.Rescale(w, h);
+}
+#endif
+