当前位置: 首页>>代码示例>>C++>>正文


C++ Rect::GetWidth方法代码示例

本文整理汇总了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);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:7,代码来源:main.cpp

示例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);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:7,代码来源:DrawDragRect.cpp

示例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);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:9,代码来源:Wnd.cpp

示例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);
    }
}
开发者ID:kolyden,项目名称:mirror,代码行数:50,代码来源:AutoHideBar.cpp

示例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());
	}
}
开发者ID:adventuregamestudio,项目名称:ags,代码行数:16,代码来源:allegrobitmap.cpp

示例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());
	}
}
开发者ID:adventuregamestudio,项目名称:ags,代码行数:16,代码来源:allegrobitmap.cpp

示例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;
}
开发者ID:adventuregamestudio,项目名称:ags,代码行数:7,代码来源:allegrobitmap.cpp

示例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);
}
开发者ID:m1h4,项目名称:AudioAnalyzer,代码行数:8,代码来源:TrackBar.cpp

示例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));
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:8,代码来源:DrawOp.cpp

示例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));
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:44,代码来源:Wnd.cpp

示例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());
    }
}
开发者ID:vexe,项目名称:r5ge,代码行数:10,代码来源:GLController.cpp

示例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;
}
开发者ID:pedia,项目名称:raidget,代码行数:12,代码来源:RichTextView.cpp

示例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));
    }
}
开发者ID:pixelspark,项目名称:corespark,代码行数:12,代码来源:tjgraphics-gdiplus.cpp

示例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);
}
开发者ID:pixelspark,项目名称:corespark,代码行数:12,代码来源:tjgraphics-cairo.cpp

示例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);
}
开发者ID:pixelspark,项目名称:corespark,代码行数:14,代码来源:tjgraphics-cairo.cpp


注:本文中的Rect::GetWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。