show a XPM image in a panel

Miguel Cartagena miguel.cartagena at gmail.com
Sun Jan 7 08:02:25 PST 2007


I try to use this event, but I take no effect!

here is the code:

BEGIN_EVENT_TABLE(MapPanel, wxPanel)
EVT_ERASE_BACKGROUND(MapPanel::OnEraseBackground)
END_EVENT_TABLE()

void MapPanel::OnEraseBackground(wxEraseEvent& event){
  wxDC* pDc=event.GetDC();

  wxBitmap *bmp = new wxBitmap(mapasc_xpm);
  if(!bmp->Ok()) return;

  pDc->DrawBitmap(*bmp, wxCoord(0), wxCoord(0), true);
}

Regards,

Miguel Cartagena

On 7 jan, 12:38, v... at wxwindows.org (Vadim Zeitlin) wrote:
> On 7 Jan 2007 06:09:18 -0800 Miguel Cartagena <miguel.cartag... at gmail.com> wrote:
>
> MC> I'm developing an application where it's necessary to place an image, a
> MC> map, on background.
>
>  Please look at EVT_ERASE_BACKGROUND().
>
>  Regards,
> VZ
>
> --
> TT-Solutions: wxWidgets consultancy and technical support
>                http://www.tt-solutions.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr... at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h... at lists.wxwidgets.org







More information about the wx-users mailing list