- // Draw the bitmap normally, its rightmost or bottom part could be
- // truncated, as it's meant to be.
+ // The bitmap will be extended to the bottom.
+ p.x = 0;
+ p.y = size.y;
+ break;
+
+ // This case is there only to prevent g++ warnings about not handling
+ // some enum elements in the switch, it can't really happen.
+ case wxALL:
+ wxFAIL_MSG( wxS("Unreachable") );
+ }
+
+ m_colBitmapBg.Set(image.GetRed(p.x, p.y),
+ image.GetGreen(p.x, p.y),
+ image.GetBlue(p.x, p.y));
+
+ return m_colBitmapBg;
+}
+
+void wxBannerWindow::DrawBitmapBackground(wxDC& dc)
+{
+ // We may need to fill the part of the background not covered by the bitmap
+ // with the solid colour extending the bitmap, this rectangle will hold the
+ // area to be filled (which could be empty if the bitmap is big enough).
+ wxRect rectSolid;
+
+ const wxSize size = GetClientSize();
+
+ switch ( m_direction )
+ {
+ case wxTOP:
+ case wxBOTTOM:
+ // Draw the bitmap at the origin, its rightmost could be truncated,
+ // as it's meant to be.