本文整理汇总了C++中wxRect::Inflate方法的典型用法代码示例。如果您正苦于以下问题:C++ wxRect::Inflate方法的具体用法?C++ wxRect::Inflate怎么用?C++ wxRect::Inflate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxRect
的用法示例。
在下文中一共展示了wxRect::Inflate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InflateDeflate
void RectTestCase::InflateDeflate()
{
// This is the rectangle from the example in the documentation of wxRect::Inflate().
const wxRect r1(10, 10, 20, 40);
CPPUNIT_ASSERT(r1.Inflate( 10, 10)==wxRect( 0, 0, 40, 60));
CPPUNIT_ASSERT(r1.Inflate( 20, 30)==wxRect(-10, -20, 60, 100));
CPPUNIT_ASSERT(r1.Inflate(-10, -10)==wxRect( 20, 20, 0, 20));
CPPUNIT_ASSERT(r1.Inflate(-15, -15)==wxRect( 20, 25, 0, 10));
CPPUNIT_ASSERT(r1.Inflate( 10, 10)==r1.Deflate(-10, -10));
CPPUNIT_ASSERT(r1.Inflate( 20, 30)==r1.Deflate(-20, -30));
CPPUNIT_ASSERT(r1.Inflate(-10, -10)==r1.Deflate( 10, 10));
CPPUNIT_ASSERT(r1.Inflate(-15, -15)==r1.Deflate( 15, 15));
}
示例2: 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());
}
}
示例3: Stroke
void SkinRegion::Stroke(wxDC& dc, wxGraphicsContext* gc, const wxRect& rect, int /*n*/)
{
if (!has_border)
return;
int penw = border.GetWidth() / 2.0f;
wxRect r(rect);
r.Deflate(penw, penw);
//border.SetCap(wxCAP_PROJECTING);
if (rounded) {
bool needsDelete = false;
if (!gc) {
gc = wxGraphicsContext::Create((wxWindowDC&)dc);
needsDelete = true;
}
gc->SetBrush(*wxTRANSPARENT_BRUSH);
gc->SetPen(border);
gc->DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, rounded * .97);
rect.Inflate(penw, penw);
if (needsDelete)
delete gc;
} else {
dc.SetPen(border);
int offset = (int)(border.GetWidth() % 2 == 0);
wxPoint x(offset, 0);
wxPoint y(0, offset);
dc.DrawLine(rect.GetTopLeft(), rect.GetBottomLeft() + y);
dc.DrawLine(rect.GetBottomLeft() + y, rect.GetBottomRight() + y + x);
dc.DrawLine(rect.GetBottomRight() + y + x, rect.GetTopRight() + x);
dc.DrawLine(rect.GetTopRight() + x, rect.GetTopLeft());
}
}