本文整理汇总了C++中Rect::GetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::GetWidth方法的具体用法?C++ Rect::GetWidth怎么用?C++ Rect::GetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::GetWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sRenderRect
static void sRenderRect(Painter& w, const Rect& r, int n, byte pattern)
{
sRenderLine(w, r.left, r.top, 1, 0, 1, n, r.GetWidth(), pattern);
sRenderLine(w, r.left, r.bottom - 1, 1, 0, 1, n, r.GetWidth(), pattern);
sRenderLine(w, r.left, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
sRenderLine(w, r.right - 1, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
}
示例2: DrawDragFrame
void DrawDragFrame(SystemDraw& w, const Rect& r, int n, int animation)
{
DrawDragLine(w, true, r.left, r.top, r.GetWidth(), n, animation);
DrawDragLine(w, false, r.left, r.top + n, r.GetHeight() - 2 * n, n, animation);
DrawDragLine(w, false, r.right - n, r.top + n, r.GetHeight() - 2 * n, n, animation);
DrawDragLine(w, true, r.left, r.bottom - n, r.GetWidth(), n, animation);
}
示例3: min
void Ctrl::DragRectDraw0(const Vector<Rect>& clip, const Rect& rect, int n, const byte *pattern, int animation)
{
int hn = min(rect.GetHeight(), n);
int vn = min(rect.GetWidth(), n);
DrawLine(clip, rect.left, rect.top, rect.GetWidth(), hn, true, pattern, animation);
DrawLine(clip, rect.left, rect.top + hn, vn, rect.GetHeight() - hn, false, pattern, animation);
DrawLine(clip, rect.right - vn, rect.top + hn, vn, rect.GetHeight() - hn, false, pattern, animation);
DrawLine(clip, rect.left + vn, rect.bottom - hn, rect.GetWidth() - 2 * vn, hn, true, pattern, animation);
}
示例4: ShowWindow
void AutoHideBar::ShowWindow()
{
DockWindow* hiddenwindow = reinterpret_cast<DockWindow*>(tabs[active].dock);
if(!hiddenwindow->IsOpen())
{
Size s = hiddenwindow->GetSizeHint();
Rect r = GetScreenRect();
Rect rr = r;
switch(layout)
{
case LAYOUT_LEFT:
rr.left = r.right;
s.cy = r.GetHeight();
#if defined(PLATFORM_X11)
rr.right += 1;
#endif
break;
case LAYOUT_TOP:
rr.top = r.bottom;
s.cx = r.GetWidth();
#if defined(PLATFORM_X11)
rr.bottom += 1;
#endif
break;
case LAYOUT_RIGHT:
rr.right = r.left;
s.cy = r.GetHeight();
#if defined(PLATFORM_X11)
rr.left -= 1;
#endif
break;
case LAYOUT_BOTTOM:
rr.bottom = r.top;
s.cx = r.GetWidth();
#if defined(PLATFORM_X11)
rr.top -= 1;
#endif
break;
}
popup.SetRect(rr);
popup.Add(hiddenwindow->SizePos());
hiddenwindow->Ctrl::Show();
popup.PopUp(GetOwner(), false, true, false, false);
ctrl = hiddenwindow;
Ctrl::ProcessEvents();
AdjustSize(rr, s);
Animate(popup, rr, GUIEFFECT_SLIDE);
}
}
示例5: StretchBlt
void Bitmap::StretchBlt(Bitmap *src, const Rect &src_rc, const Rect &dst_rc, BitmapMaskOption mask)
{
BITMAP *al_src_bmp = src->_alBitmap;
if (mask == kBitmap_Transparency)
{
masked_stretch_blit(al_src_bmp, _alBitmap,
src_rc.Left, src_rc.Top, src_rc.GetWidth(), src_rc.GetHeight(),
dst_rc.Left, dst_rc.Top, dst_rc.GetWidth(), dst_rc.GetHeight());
}
else
{
stretch_blit(al_src_bmp, _alBitmap,
src_rc.Left, src_rc.Top, src_rc.GetWidth(), src_rc.GetHeight(),
dst_rc.Left, dst_rc.Top, dst_rc.GetWidth(), dst_rc.GetHeight());
}
}
示例6: AAStretchBlt
void Bitmap::AAStretchBlt(Bitmap *src, const Rect &dst_rc, BitmapMaskOption mask)
{
BITMAP *al_src_bmp = src->_alBitmap;
// WARNING: For some evil reason Allegro expects dest and src bitmaps in different order for blit and draw_sprite
if (mask == kBitmap_Transparency)
{
aa_stretch_sprite(_alBitmap, al_src_bmp,
dst_rc.Left, dst_rc.Top, dst_rc.GetWidth(), dst_rc.GetHeight());
}
else
{
aa_stretch_blit(al_src_bmp, _alBitmap,
0, 0, al_src_bmp->w, al_src_bmp->h,
dst_rc.Left, dst_rc.Top, dst_rc.GetWidth(), dst_rc.GetHeight());
}
}
示例7: CreateSubBitmap
bool Bitmap::CreateSubBitmap(Bitmap *src, const Rect &rc)
{
Destroy();
_alBitmap = create_sub_bitmap(src->_alBitmap, rc.Left, rc.Top, rc.GetWidth(), rc.GetHeight());
_isDataOwner = true;
return _alBitmap != nullptr;
}
示例8: GetTrackBox
Rect TrackBar::GetTrackBox(void) const
{
Rect box = GetBoundingBox();
Size size(8,box.GetHeight());
return Rect(Point(box.left + box.GetWidth() * GetTrackValue() / GetTrackRange() - size.cx / 2,box.top + box.GetHeight() / 2 - size.cy / 2 + 2),size);
}
示例9: DrawImageOp
void Painter::DrawImageOp(int x, int y, int cx, int cy, const Image& image, const Rect& src, Color color)
{
Image img = IsNull(color) ? image : SetColorKeepAlpha(image, color);
RectPath(x, y, cx, cy);
double sw = (double)cx / src.GetWidth();
double sh = (double)cy / src.GetHeight();
Fill(img, Xform2D::Scale(sw, sh) * Xform2D::Translation(x - sw * src.left, y - sh * src.top));
}
示例10: Intersection
void Ctrl::WndScrollView0(const Rect& r, int dx, int dy)
{
GuiLock __;
if(dx == 0 && dy == 0)
return;
if(dx && dy) {
Refresh(r);
return;
}
RemoveCursor();
RemoveCaret();
Rect sr = r.Offseted(GetScreenRect().TopLeft());
Vector<Rect> pr = Intersection(GetPaintRects(), sr);
for(int i = 0; i < pr.GetCount(); i++) {
Rect r = pr[i];
if(dx) {
int n = r.GetWidth() - abs(dx);
if(n > 0) {
int to = r.left + dx * (dx > 0);
int from = r.left - dx * (dx < 0);
for(int y = r.top; y < r.bottom; y++)
memmove(framebuffer[y] + to, framebuffer[y] + from, n * sizeof(RGBA));
}
n = min(abs(dx), r.GetWidth());
Refresh(dx < 0 ? r.left : r.right - n, r.top, n, r.GetHeight());
}
else {
int n = r.GetHeight() - abs(dy);
for(int y = 0; y < n; y++)
memmove(framebuffer[dy < 0 ? r.top + y : r.bottom - 1 - y] + r.left,
framebuffer[dy < 0 ? r.top + y - dy : r.bottom - 1 - y - dy] + r.left,
r.GetWidth() * sizeof(RGBA));
n = min(abs(dy), r.GetHeight());
Refresh(r.left, dy < 0 ? r.bottom - n : r.top, r.GetWidth(), n);
}
}
Vector<Rect> ur;
for(int i = 0; i < invalid.GetCount(); i++)
if(invalid[i].Intersects(sr))
ur.Add(invalid[i]);
for(int i = 0; i < ur.GetCount(); i++)
AddInvalid(ur[i].Offseted(dx, dy));
}
示例11: SetScissorRect
void GLController::SetScissorRect (const Rect& rect)
{
if (mScissorRect != rect)
{
mScissorRect = rect;
const Vector2i& size = GetActiveViewport();
glScissor((GLint)rect.left, (GLint)size.y - (GLint)rect.bottom,
(GLsizei)rect.GetWidth(), (GLsizei)rect.GetHeight());
}
}
示例12: Print
bool Print(const RichText& text, const Rect& page, int currentpage, const char *name)
{
PrinterJob pj(name);
pj.CurrentPage(currentpage);
pj.PageCount(text.GetHeight(page).page + 1);
pj.Landscape(page.GetWidth() > page.GetHeight());
if(pj.Execute()) {
Print(pj, text, page, pj.GetPages());
return true;
}
return false;
}
示例13: DrawImage
void Graphics::DrawImage(Image* image, const Rect& rc, const ImageAttributes* attr) {
Gdiplus::Graphics* g = reinterpret_cast<Gdiplus::Graphics*>(_private);
Gdiplus::Image* gdiImage = reinterpret_cast<Gdiplus::Image*>(image->_private);
if(attr!=0) {
Gdiplus::ImageAttributes* ia = reinterpret_cast<Gdiplus::ImageAttributes*>(attr->_private);
g->DrawImage(gdiImage, Gdiplus::Rect(rc.GetLeft(), rc.GetTop(), rc.GetWidth(), rc.GetHeight()), 0, 0, gdiImage->GetWidth(), gdiImage->GetHeight(), Gdiplus::UnitPixel, ia);
}
else {
g->DrawImage(gdiImage, ToGDIRect<Rect, Gdiplus::Rect>(rc));
}
}
示例14: DrawRectangle
void Graphics::DrawRectangle(Pen* pen, const Rect& rc) {
cairo_t* cg = reinterpret_cast<cairo_t*>(_private);
cairo_save(cg);
PenPrivate* pp = reinterpret_cast<PenPrivate*>(pen->_private);
cairo_pattern_t* cp = pp->pattern;
cairo_set_source(cg, cp);
cairo_set_line_width(cg, pp->width);
cairo_translate(cg, rc.GetLeft(), rc.GetTop());
cairo_rectangle(cg, 0, 0, rc.GetWidth(), rc.GetHeight());
cairo_stroke(cg);
cairo_restore(cg);
}
示例15: FillRectangle
void Graphics::FillRectangle(Brush* brush, const Rect& rc) {
cairo_t* cg = reinterpret_cast<cairo_t*>(_private);
cairo_save(cg);
if(cg!=0) {
cairo_pattern_t* cp = reinterpret_cast<cairo_pattern_t*>(brush->_private);
if(cp!=0) {
cairo_set_source(cg, cp);
cairo_translate(cg, rc.GetLeft(), rc.GetTop());
cairo_rectangle(cg, 0, 0, rc.GetWidth(), rc.GetHeight());
cairo_fill(cg);
}
}
cairo_restore(cg);
}