本文整理汇总了C++中wxBitmap::SetMask方法的典型用法代码示例。如果您正苦于以下问题:C++ wxBitmap::SetMask方法的具体用法?C++ wxBitmap::SetMask怎么用?C++ wxBitmap::SetMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxBitmap
的用法示例。
在下文中一共展示了wxBitmap::SetMask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Mask
void BitmapTestCase::Mask()
{
wxMask *mask = new wxMask(m_bmp, *wxBLACK);
m_bmp.SetMask(mask);
// copying masks should work
wxMask *mask2 = new wxMask(*mask);
m_bmp.SetMask(mask2);
}
示例2: bmp
////////////////////////////////////////////////////////////////////
// Method: Constructor
// Class: CWxOpencvAbout
// Purpose: Initialize my about dialog
// Input: pointer to reference window
// Output: nothing
////////////////////////////////////////////////////////////////////
CWxOpencvAbout::CWxOpencvAbout(wxWindow *parent)
: wxDialog(parent, -1,
_("About wxOpenCv Demo"),
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxCLOSE)
{
// logo
const wxBitmap bmp(wxImage("wxopencvabout.bmp"));
#if !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXMAC__)
bmp.SetMask(new wxMask(bmp, *wxBLUE));
#endif
wxStaticBitmap *sbmp = new wxStaticBitmap(this, -1, bmp);
// layout components
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
sizer->Add( sbmp, 0, wxCENTRE | wxALL, 10 );
sizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 5 );
sizer->Add( CreateTextSizer(_("wxOpenCv Demo\n"
"(demo of opencv with wxwidgets)\n"
"Created by: Larry Lart\n"
"Email To: [email protected]\n") ),
0, wxCENTRE | wxALL, 10 );
sizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT, 5 );
sizer->Add( CreateButtonSizer(wxOK), 0, wxCENTRE | wxALL, 10 );
// activate
SetSizer(sizer);
SetAutoLayout(TRUE);
sizer->SetSizeHints(this);
sizer->Fit(this);
Centre(wxBOTH | wxCENTRE_ON_SCREEN);
}
示例3: OverlappingBlit
void BitmapTestCase::OverlappingBlit()
{
m_bmp.SetMask( NULL );
// Clear to white.
wxMemoryDC dc(m_bmp);
dc.SetBackground( *wxWHITE );
dc.Clear();
// Draw red line across the top.
dc.SetPen(*wxRED_PEN);
dc.DrawLine(0, 0, 10, 0);
// Scroll down one line.
dc.Blit( 0, 1, 10, 9, &dc, 0, 0 );
// Now, lines 0 and 1 should be red, lines 2++ should still be white.
wxNativePixelData npd( m_bmp );
wxNativePixelData::Iterator it( npd );
ASSERT_EQUAL_RGB( it, 255, 0, 0 );
it.OffsetY( npd, 1 );
ASSERT_EQUAL_RGB( it, 255, 0, 0 );
it.OffsetY( npd, 1 );
ASSERT_EQUAL_RGB( it, 255, 255, 255 );
it.OffsetY( npd, 1 );
ASSERT_EQUAL_RGB( it, 255, 255, 255 );
}