本文整理汇总了C++中wxDC::SetBackground方法的典型用法代码示例。如果您正苦于以下问题:C++ wxDC::SetBackground方法的具体用法?C++ wxDC::SetBackground怎么用?C++ wxDC::SetBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxDC
的用法示例。
在下文中一共展示了wxDC::SetBackground方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TwoRegionsNonOverlappingNegDim
void ClippingBoxTestCaseBase::TwoRegionsNonOverlappingNegDim()
{
// Setting one clipping box with negative size values
// and next another box (non-overlapping).
// Final clipping box should be empty.
m_dc->SetClippingRegion(10, 20, -80, -75);
m_dc->SetClippingRegion(50, 60, 50, 40);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, 0, 0);
}
示例2: InitialStateWithTransformedDC
void ClippingBoxTestCaseBase::InitialStateWithTransformedDC()
{
// Initial clipping box with transformed DC.
m_dc->SetDeviceOrigin(10, 15);
m_dc->SetUserScale(0.5, 1.5);
m_dc->SetLogicalScale(4.0, 2.0);
m_dc->SetLogicalOrigin(-15, -20);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(-20, -25, 50, 40);
}
示例3: Render
void PaintDrawPanel::Render(wxDC& dc)
{
// Clear
dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
if (mModel)
{
mModel->DrawShapes(dc);
}
}
示例4: TwoRegionsOverlappingNegDim
void ClippingBoxTestCaseBase::TwoRegionsOverlappingNegDim()
{
// Setting one clipping box with negative size values
// and next another box (partially overlapping).
// Final clipping box should be an intersection of these two boxes
// with positive size values.
m_dc->SetClippingRegion(90, 95, -80, -75);
m_dc->SetClippingRegion(50, 60, 50, 40);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(50, 60, 41, 36);
}
示例5: DrawThumbnail
void wxPDFViewPage::DrawThumbnail(wxPDFViewPagesClient* client, wxDC& dc, const wxRect& rect)
{
dc.SetBackground(*wxTRANSPARENT_BRUSH);
dc.SetPen(*wxLIGHT_GREY_PEN);
dc.DrawRectangle(rect.Inflate(1, 1));
wxBitmap bmp = client->GetCachedBitmap(m_index, rect.GetSize());
if (bmp.Ok())
{
dc.DrawBitmap(bmp, rect.GetPosition());
}
}
示例6: RenderFrame
void ZLauncherFrame::RenderFrame(wxDC& dc)
{
if (m_backgroundImg.IsOk())
{
dc.DrawBitmap(m_backgroundImg, 0, 0);
}
else
{
dc.SetBackground( APPLICATION_BACKGROUND );
dc.Clear();
}
}
示例7: OneRegionWithTransformedDC
void ClippingBoxTestCaseBase::OneRegionWithTransformedDC()
{
// Setting one clipping box inside DC area
// with applied some transformations.
m_dc->SetDeviceOrigin(10, 15);
m_dc->SetUserScale(0.5, 1.5);
m_dc->SetLogicalScale(4.0, 2.0);
m_dc->SetLogicalOrigin(-15, -20);
m_dc->SetClippingRegion(-10, -20, 80, 75);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(-10, -20, 40, 35);
}
示例8: Render
void PreviewWindow::Render(wxDC& dc)
{
dc.SetBackground(wxBrush(backgroundColour));
dc.Clear();
DrawPath(dc);
DrawTrajectory(dc);
DrawOrigin(dc);
wxString text;
text << wxT("X: ") << offset.x << wxT(" Y: ") << offset.y
<< wxT(" Z: ") << wheelPosition;
dc.SetTextForeground(wxColour(255, 255, 255));
dc.DrawText(text, 40, 10);
}
示例9: SwitchSelState
static void SwitchSelState(wxDC& dc, wxHtmlRenderingInfo& info,
bool toSelection)
{
wxColour fg = info.GetState().GetFgColour();
wxColour bg = info.GetState().GetBgColour();
if ( toSelection )
{
dc.SetBackgroundMode(wxSOLID);
dc.SetTextForeground(info.GetStyle().GetSelectedTextColour(fg));
dc.SetTextBackground(info.GetStyle().GetSelectedTextBgColour(bg));
dc.SetBackground(wxBrush(info.GetStyle().GetSelectedTextBgColour(bg),
wxSOLID));
}
else
{
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetTextForeground(fg);
dc.SetTextBackground(bg);
dc.SetBackground(wxBrush(bg, wxSOLID));
}
}
示例10: render
void StateEvaluationTreePanel::render(wxDC &dc)
{
if (Settings.m_ColourScheme == nullptr)
return;
PrepareDC(dc);
auto const &Scheme = *(Settings.m_ColourScheme);
dc.SetBackground(wxBrush{Scheme.getDefault().GetBackground()});
dc.Clear();
if (Statement.empty())
return;
auto const ActiveStmt = ActiveFn->getActiveStmt();
if (!ActiveStmt)
return;
dc.SetFont(CodeFont);
// Draw the sub-Stmts' nodes.
for (auto const &Node : Nodes) {
// Don't draw hovered nodes, they will be drawn later.
if (&*HoverNodeIt == &Node || &*ReplayHoverNodeIt == &Node)
continue;
auto const DoHighlight =
(HighlightedStmt && Node.Statement == HighlightedStmt)
|| (HighlightedValue && Node.Value.get() == HighlightedValue);
if (DoHighlight)
drawNode(dc, Scheme, Node, NodeDecoration::Highlighted);
else if (Node.Statement == ActiveStmt)
drawNode(dc, Scheme, Node, NodeDecoration::Active);
else
drawNode(dc, Scheme, Node, NodeDecoration::None);
}
// Redraw the hovered nodes, so that they outrank active node highlighting.
if (HoverNodeIt != Nodes.end())
drawNode(dc, Scheme, *HoverNodeIt, NodeDecoration::Highlighted);
if (ReplayHoverNodeIt != Nodes.end())
drawNode(dc, Scheme, *ReplayHoverNodeIt, NodeDecoration::Highlighted);
// Draw the pretty-printed Stmt's string.
dc.SetTextForeground(Scheme.getDefault().GetForeground());
wxCoord const PageBorderH = dc.GetCharWidth() * Settings.PageBorderHorizontal;
wxCoord const PageBorderV = dc.GetCharHeight() * Settings.PageBorderVertical;
dc.DrawText(Statement, PageBorderH, PageBorderV);
}
示例11: Render
void wxlCan::Render( wxDC& dc )
{
int w,h;
GetVirtualSize( &w, &h );
dc.SetBackground( GetBackgroundColour() );
dc.Clear();
dc.SetBrush(m_backbrush);
dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle( 0, 0, w, h );
//draw objects
m_rootobject.Draw( dc, 0, 0 );
}
示例12: DrawKDETheme
static void DrawKDETheme(wxDC& dc,wxSize size)
{
wxPen pen;
pen.SetStyle(wxSOLID);
wxBrush brush(kdetheme[13],wxSOLID);
dc.SetBackground(brush);
dc.Clear();
for(int i=0;i<14;i++) {
pen.SetColour(kdetheme[i]);
dc.SetPen(pen);
dc.DrawLine(0,i,size.GetWidth()-1,i);
dc.DrawLine(0,size.GetHeight()-1-i,
size.GetWidth()-1,size.GetHeight()-1-i);
}
};
示例13: draw_area
void SliderBar::draw_area(wxDC & dc)
{
wxCoord w,h;
int pixw;
dc.SetBackground(_bgbrush);
dc.Clear();
dc.SetBrush(_borderbrush);
dc.SetPen(_borderpen);
dc.DrawRectangle (0, 0, _width, _height);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(_barbrush);
if (_bar_style == FromLeftStyle)
{
pixw = (int) ((_value - _lower_bound) / _val_scale);
dc.DrawRectangle (1, 1, pixw-1, _height-2);
}
else if (_bar_style == FromRightStyle)
{
pixw = (int) ((_upper_bound - _value) / _val_scale);
dc.DrawRectangle (pixw, 1, _width - pixw - 1, _height-2);
}
if (_bar_style != HiddenStyle)
{
dc.SetBrush(_linebrush);
pixw = (int) ((_value - _lower_bound) / _val_scale);
dc.DrawRectangle (pixw - 1, 1, 2, _height-2);
}
dc.SetTextForeground(_textcolor);
dc.GetTextExtent(_label_str, &w, &h);
dc.DrawText (_label_str, 3, _height - h - 3);
if (_showval_flag) {
dc.SetTextForeground(_valuecolor);
dc.GetTextExtent(_value_str, &w, &h);
dc.DrawText (_value_str, _width - w - 3, _height - h - 3);
}
}
示例14: render
void BasicDrawPane::render(wxDC &dc) {
static int frames = 0;
frames++;
static wxString draw_text = "";
auto new_timestamp = std::chrono::high_resolution_clock::now();
// Calculate framerate every second
if (std::chrono::duration_cast<std::chrono::seconds>(new_timestamp - timestamp_).count() >= 1) {
timestamp_ = new_timestamp;
std::stringstream ss;
ss << "FPS: " << frames;
frames = 0;
draw_text = ss.str();
}
dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
dc.DrawText(draw_text, 0, 0);
}
示例15: Draw
void MyApp::Draw(wxDC&dc)
{
// This routine just draws a bunch of random stuff on the screen so that we
// can check that different types of object are being drawn consistently
// between the screen image, the print preview image (at various zoom
// levels), and the printed page.
dc.SetBackground(*wxWHITE_BRUSH);
// dc.Clear();
dc.SetFont(m_testFont);
// dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(*wxLIGHT_GREY_BRUSH);
dc.DrawRectangle(0, 0, 230, 350);
dc.DrawLine(0, 0, 229, 349);
dc.DrawLine(229, 0, 0, 349);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxRED_PEN);
dc.DrawRoundedRectangle(0, 20, 200, 80, 20);
dc.DrawText( wxT("Rectangle 200 by 80"), 40, 40);
dc.SetPen( wxPen(*wxBLACK, 0, wxPENSTYLE_DOT_DASH) );
dc.DrawEllipse(50, 140, 100, 50);
dc.SetPen(*wxRED_PEN);
dc.DrawText( wxT("Test message: this is in 10 point text"), 10, 180);
#if wxUSE_UNICODE
const char *test = "Hebrew שלום -- Japanese (日本語)";
wxString tmp = wxConvUTF8.cMB2WC( test );
dc.DrawText( tmp, 10, 200 );
#endif
wxPoint points[5];
points[0].x = 0;
points[0].y = 0;
points[1].x = 20;
points[1].y = 0;
points[2].x = 20;
points[2].y = 20;
points[3].x = 10;
points[3].y = 20;
points[4].x = 10;
points[4].y = -20;
dc.DrawPolygon( 5, points, 20, 250, wxODDEVEN_RULE );
dc.DrawPolygon( 5, points, 50, 250, wxWINDING_RULE );
dc.DrawEllipticArc( 80, 250, 60, 30, 0.0, 270.0 );
points[0].x = 150;
points[0].y = 250;
points[1].x = 180;
points[1].y = 250;
points[2].x = 180;
points[2].y = 220;
points[3].x = 200;
points[3].y = 220;
dc.DrawSpline( 4, points );
dc.DrawArc( 20,10, 10,10, 25,40 );
wxString str;
int i = 0;
str.Printf( wxT("---- Text at angle %d ----"), i );
dc.DrawRotatedText( str, 100, 300, i );
i = m_angle;
str.Printf( wxT("---- Text at angle %d ----"), i );
dc.DrawRotatedText( str, 100, 300, i );
wxIcon my_icon = wxICON(sample);
dc.DrawIcon( my_icon, 100, 100);
if (m_bitmap.IsOk())
dc.DrawBitmap( m_bitmap, 10, 10 );
#if wxUSE_GRAPHICS_CONTEXT
wxGraphicsContext *gc = NULL;
wxPrinterDC *printer_dc = wxDynamicCast( &dc, wxPrinterDC );
if (printer_dc)
gc = wxGraphicsContext::Create( *printer_dc );
wxWindowDC *window_dc = wxDynamicCast( &dc, wxWindowDC );
if (window_dc)
gc = wxGraphicsContext::Create( *window_dc );
#ifdef __WXMSW__
wxEnhMetaFileDC *emf_dc = wxDynamicCast( &dc, wxEnhMetaFileDC );
if (emf_dc)
gc = wxGraphicsContext::Create( *emf_dc );
#endif
//.........这里部分代码省略.........