本文整理汇总了C++中wxDC::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ wxDC::Clear方法的具体用法?C++ wxDC::Clear怎么用?C++ wxDC::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxDC
的用法示例。
在下文中一共展示了wxDC::Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
void LWSlider::OnPaint(wxDC &dc, bool WXUNUSED(selected))
{
//thumbPos should be in pixels
int thumbPos = ValueToPosition(mCurrentValue);
int thumbOrtho; // position in axis orthogonal to mOrientation
if (mOrientation == wxHORIZONTAL)
thumbOrtho = mCenterY - (mThumbHeight/2);
else
thumbOrtho = mCenterX - (mThumbWidth/2);
#if defined(__WXMSW__)
if( mHW )
{
dc.Clear();
}
#endif
#if defined(__WXGTK__)
if (mHW)
{
dc.SetBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
dc.Clear();
}
#endif
dc.DrawBitmap(*mBitmap, mLeft, mTop, true);
if (mOrientation == wxHORIZONTAL)
dc.DrawBitmap(*mThumbBitmap, mLeft+thumbPos, mTop+thumbOrtho, true);
else
dc.DrawBitmap(*mThumbBitmap, mLeft+thumbOrtho, mTop+thumbPos, true);
if (LWSlider::sharedTipPanel)
LWSlider::sharedTipPanel->Refresh();
}
示例2: InitialState
void ClippingBoxTestCaseBase::InitialState()
{
// Initial clipping box should be the same as the entire DC surface.
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, s_dcSize.GetWidth(), s_dcSize.GetHeight());
}
示例3: render
void bmImage::render(wxDC& dc) {
bitmap = wxBitmap(aswxImage);
dc.Clear();
// few variables to make life easier
cv::Vec2f pScale = cv::Vec2f(((bmImageFrame*)this->GetParent())->scale);
cv::Vec2f pVOffScale = cv::Vec2f(((bmImageFrame*)this->GetParent())->voff);
cv::Vec2f pScroll = cv::Vec2f(((bmImageFrame*)this->GetParent())->scroll);
wxPoint orgp = dc.GetLogicalOrigin();
wxPoint trp(pScroll[0], pScroll[1]);
if (asCvMat.cols * pScale[0] < this->GetSize().GetWidth()) {
trp.x = -(this->GetSize().GetWidth() - asCvMat.cols * pScale[0]) / 2 / pScale[0];
}
if (asCvMat.rows * pScale[1] < this->GetSize().GetHeight()) {
trp.y = -(this->GetSize().GetHeight() - asCvMat.rows * pScale[1]) / 2 / pScale[1];
}/*
trp += wxPoint(
-(this->GetSize().GetWidth() - asCvMat.cols * pVOffScale[0]) / 2 / pVOffScale[0],
-(this->GetSize().GetHeight() - asCvMat.rows * pVOffScale[1]) / 2 / pVOffScale[1]
);*/
trp += wxPoint(
-asCvMat.cols * (pVOffScale[0] - 1.0f) / 2,
-asCvMat.rows * (pVOffScale[1] - 1.0f) / 2
);
dc.SetLogicalOrigin(trp.x, trp.y);
dc.SetUserScale(pScale[0], pScale[1]);
dc.DrawBitmap(bitmap, wxPoint(0, 0), false);
dc.SetLogicalOrigin(orgp.x, orgp.y);
}
示例4: OneRegion
void ClippingBoxTestCaseBase::OneRegion()
{
// Setting one clipping box inside DC area.
m_dc->SetClippingRegion(10, 20, 80, 75);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(10, 20, 80, 75);
}
示例5: OneRegionNegDim
void ClippingBoxTestCaseBase::OneRegionNegDim()
{
// Setting one clipping box with negative sizes values.
// Final clipping box should have standard positive size values.
m_dc->SetClippingRegion(10, 20, -80, -75);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, 11, 21);
}
示例6: OneOuterRegion
void ClippingBoxTestCaseBase::OneOuterRegion()
{
// Setting one clipping box entirely outside DC surface.
// Final clipping box should be empty.
m_dc->SetClippingRegion(-100, -80, 20, 40);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, 0, 0);
}
示例7: TwoRegionsNonOverlapping
void ClippingBoxTestCaseBase::TwoRegionsNonOverlapping()
{
// Setting one clipping box and next another box (non-overlapping).
// Final clipping box should be empty.
m_dc->SetClippingRegion(10, 20, 30, 30);
m_dc->SetClippingRegion(50, 60, 50, 40);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, 0, 0);
}
示例8:
void
ClueListBox::OnDrawBackground(wxDC & dc, const wxRect & rect, size_t n) const
{
if (IsSelected(n))
dc.SetBackground(GetSelectionBackground());
else
dc.SetBackground(GetBackgroundColour());
dc.Clear();
}
示例9: TwoRegionsOverlapping
void ClippingBoxTestCaseBase::TwoRegionsOverlapping()
{
// Setting one clipping box and next another box (partially overlapping).
// Final clipping box should be an intersection of these two boxes.
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(50, 60, 40, 35);
}
示例10: OneRegionAndEmpty
void ClippingBoxTestCaseBase::OneRegionAndEmpty()
{
// Setting one clipping box and next an empty box.
// Final clipping box should empty.
m_dc->SetClippingRegion(10, 20, 80, 75);
m_dc->SetClippingRegion(0, 0, 0, 0);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, 0, 0);
}
示例11: OneRegionAndReset
void ClippingBoxTestCaseBase::OneRegionAndReset()
{
// Setting one clipping box and next destroy it.
// Final clipping box should be the same as DC surface.
m_dc->SetClippingRegion(10, 20, 80, 75);
m_dc->DestroyClippingRegion();
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, s_dcSize.GetWidth(), s_dcSize.GetHeight());
}
示例12: OneLargeRegion
void ClippingBoxTestCaseBase::OneLargeRegion()
{
// Setting one clipping box larger then DC surface.
// Final clipping box should be limited to the DC extents.
m_dc->SetClippingRegion(-10, -20,
s_dcSize.GetWidth()+30, s_dcSize.GetHeight()+50);
m_dc->SetBackground(wxBrush(s_fgColour, wxBRUSHSTYLE_SOLID));
m_dc->Clear();
CheckBox(0, 0, s_dcSize.GetWidth(), s_dcSize.GetHeight());
}
示例13: Render
void PaintDrawPanel::Render(wxDC& dc)
{
// Clear
dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
if (mModel)
{
mModel->DrawShapes(dc);
}
}
示例14: render
void CurvePane::render(wxDC& dc)
{
double px = 0.0;
double py = 0.0;
double x=0, y=0;
dc.Clear();
int w, h;
dc.GetSize(&w, &h);
int m=10;
int radius;
wxConfigBase::Get()->Read("tool.curve.controlpointradius",&radius,5);
//x axis:
dc.DrawLine(m,h-m,m,h-m-255);
//y axis:
dc.DrawLine(m,h-m,m+255,h-m);
//center lines:
dc.SetPen(*wxLIGHT_GREY_PEN);
dc.DrawLine(m+128,h-m,m+128,h-m-255);
dc.DrawLine(m,h-m-128,m+255,h-m-128);
//null curve:
dc.DrawLine(m,h-m,m+255,h-m-255);
//quarter lines:
dc.SetPen(wxPen(wxColour(192,192,192), 1, wxPENSTYLE_DOT_DASH ));
dc.DrawLine(m+64,h-m,m+64,h-m-255);
dc.DrawLine(m,h-m-64,m+255,h-m-64);
dc.DrawLine(m+192,h-m,m+192,h-m-255);
dc.DrawLine(m,h-m-192,m+255,h-m-192);
dc.SetPen(*wxBLACK_PEN);
//double ax = ((double) w/x);
//double ay = ((double) h/y)*z;
for (double x=0.0; x<256.0; x++) {
y=c.getpoint(x);
if (y>255.0) y = 255.0; if (y<0.0) y=0.0;
dc.DrawLine(m+px,h-m-py,m+x,h-m-y);
px = x;
py = y;
}
//if (mousemotion)dc.DrawCircle(pos,5);
std::vector<cp> controlpts = c.getControlPoints();
for (unsigned int i=0; i<controlpts.size(); i++) {
if ((controlpts[i].x == selectedCP.x) & (controlpts[i].y == selectedCP.y)) {
//dc.DrawText(wxString::Format("%d,%d",selectedCP.x,selectedCP.y),selectedCP.x-20,selectedCP.y-20);
dc.SetPen(*wxRED_PEN);
}
dc.DrawCircle(m+controlpts[i].x,h-m-controlpts[i].y,radius);
dc.SetPen(*wxBLACK_PEN);
}
}
示例15: 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);
}