don't erase the background to see the transparent images better
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9ae2ec95cf
commit
0c543b7a19
@ -135,11 +135,15 @@ public:
|
|||||||
SetClientSize(bitmap.GetWidth(), bitmap.GetHeight());
|
SetClientSize(bitmap.GetWidth(), bitmap.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnEraseBackground(wxEraseEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
// do nothing here to be able to see how transparent images are shown
|
||||||
|
}
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& WXUNUSED(event))
|
void OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc( this );
|
wxPaintDC dc( this );
|
||||||
//TRUE for masked images
|
dc.DrawBitmap( m_bitmap, 0, 0, TRUE /* use mask */ );
|
||||||
dc.DrawBitmap( m_bitmap, 0, 0, TRUE );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSave(wxMouseEvent& WXUNUSED(event))
|
void OnSave(wxMouseEvent& WXUNUSED(event))
|
||||||
@ -237,8 +241,9 @@ IMPLEMENT_APP(MyApp)
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(MyCanvas, wxScrolledWindow)
|
IMPLEMENT_DYNAMIC_CLASS(MyCanvas, wxScrolledWindow)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyImageFrame, wxFrame)
|
BEGIN_EVENT_TABLE(MyImageFrame, wxFrame)
|
||||||
EVT_PAINT(MyImageFrame::OnPaint)
|
EVT_ERASE_BACKGROUND(MyImageFrame::OnEraseBackground)
|
||||||
EVT_LEFT_DCLICK(MyImageFrame::OnSave)
|
EVT_PAINT(MyImageFrame::OnPaint)
|
||||||
|
EVT_LEFT_DCLICK(MyImageFrame::OnSave)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
||||||
|
Loading…
Reference in New Issue
Block a user