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


C++ RectF类代码示例

本文整理汇总了C++中RectF的典型用法代码示例。如果您正苦于以下问题:C++ RectF类的具体用法?C++ RectF怎么用?C++ RectF使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RectF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SelectItemsWithin

void CRender::SelectItemsWithin(const RectF &r)
{
	CComPtr<boost::scoped_lock_ref_counted> lock;
	CComPtr<IGraphItem> item;
	CComPtr<IUnknown> unk;
	CComQIPtr<IRenderer> ir;
	RectF box;

	IGraphItemVector results;
	m_graph->GetChildren(results);

	for(IGraphItemVector::iterator itr=results.begin(); itr!=results.end(); ++itr)
	{
		item=*itr;			
		unk=item->GetPropertyUnknown(0);

		if(unk)
		{
			ir=static_cast<IRenderer*>(unk.p);
			if(ir!=0)
			{
				ir->GetBoundsBox(box);
				if(box.IntersectsWith(r))
					ir->SetSelected(true, true);
			}
		}
	}
}
开发者ID:GordonSmith,项目名称:eclide,代码行数:28,代码来源:renderImpl.cpp

示例2: GPDrawShadowTextSimple

void GPDrawShadowTextSimple( Graphics&gc, CString& strTxtIn, CRect& rcIn, Gdiplus::Font& fontIn, ARGB BrushClrIn, ARGB shadowBrushClrIn /*= 0xff000000*/, int nOffXIn /*= 2*/, int nOffYIn /*= 2*/, StringFormat* fmtIn /*= NULL*/ )
{
	Gdiplus::Font& gcfont = fontIn;
	Rect rcText = CRect2Rect(rcIn);
	StringFormat fmt;
	fmt.SetAlignment(StringAlignmentCenter);
	fmt.SetTrimming(StringTrimmingEllipsisWord);
	fmt.SetLineAlignment(StringAlignmentCenter);
	StringFormat& fmtUse = fmtIn == NULL? fmt:*fmtIn;

	GraphicsContainer  gcContainer = gc.BeginContainer();
	gc.SetSmoothingMode(SmoothingModeAntiAlias);
	CComBSTR btrTxtIn(strTxtIn);

	SolidBrush textbrush(ARGB2Color(shadowBrushClrIn));
	RectF rfText = Rect2RectF(rcText);
	if (shadowBrushClrIn != 0)
	{
		rfText.Offset(1.0, 1.0);
		gc.DrawString(btrTxtIn, -1, &gcfont, rfText, &fmtUse, &textbrush);
	}

	textbrush.SetColor(ARGB2Color(BrushClrIn));
	gc.DrawString(btrTxtIn, -1, &gcfont, rfText, &fmtUse, &textbrush);
	gc.EndContainer(gcContainer);
}
开发者ID:tianyx,项目名称:TxUIProject,代码行数:26,代码来源:GDIDrawFunc.cpp

示例3: AssertFatal

void GFXDrawUtil::drawBitmapSR( GFXTextureObject*texture, const Point2F &in_rAt, const RectF &srcRect, const GFXBitmapFlip in_flip /*= GFXBitmapFlip_None*/, const GFXTextureFilterType filter /*= GFXTextureFilterPoint */ , bool in_wrap /*= true*/ )
{
   AssertFatal( texture != 0, "No texture specified for drawBitmapSR()" );

   RectF stretch( in_rAt.x, in_rAt.y, srcRect.len_x(), srcRect.len_y() );
   drawBitmapStretchSR( texture, stretch, srcRect, in_flip, filter, in_wrap );
}
开发者ID:mray,项目名称:terminal-overload,代码行数:7,代码来源:gfxDrawUtil.cpp

示例4: CreateSharedPtrWithReleaseDLL

	void CoreLayer2D_Imp::DrawRotatedRectangleAdditionally(RectF drawingArea, Color color, Vector2DF rotationCenter, float angle, RectF uv, Texture2D* texture, AlphaBlendMode alphaBlend, int32_t priority)
	{
		Sprite sprite;

		std::array<Color, 4> col = { color, color, color, color };

		SafeAddRef(texture);

		auto vertexes = drawingArea.GetVertexes();

		auto globalCenter = vertexes[0] + rotationCenter;

		for (auto& vert : vertexes)
		{
			vert -= globalCenter;
			auto deg = vert.GetDegree();
			deg += angle;
			vert.SetDegree(deg);
			vert += globalCenter;
		}


		sprite.pos = vertexes;
		sprite.col = col;
		sprite.uv = uv.GetVertexes();
		sprite.Texture_ = CreateSharedPtrWithReleaseDLL(texture);
		sprite.AlphaBlend_ = alphaBlend;
		sprite.Priority = priority;

		sprites.push_back(sprite);
	}
开发者ID:Pctg-x8,项目名称:Altseed,代码行数:31,代码来源:asd.CoreLayer2D_Imp.cpp

示例5: r

    void TreeInspectorPreview::init(spActor item)
    {
        //_item = item;
        STDRenderer r(&_videoCache);
        RenderState rs;
        rs.renderer = &r;
        rs.transform = item->getTransform();
        r.begin(0);
        //r.setTransform(rs.transform);
        item->doRender(rs);
        r.end();
        r.drawBatch();

        setSize(30, 30);

        RectF itemRect = _videoCache._bounds;
        if (itemRect.isEmpty())
        {
            itemRect = item->getDestRect();
            if (itemRect.isEmpty())
                itemRect.setSize(Vector2(10, 4));
        }

        Vector2 ns = fitSize(Vector2(50.0f, 50.0f), itemRect.size);
        float scale = ns.x / itemRect.size.x;

        _cacheTransform.identity();

        _cacheTransform.scale(Vector2(scale, scale));
        _cacheTransform.translate(-itemRect.pos);



        AnimationFrame fr = _tree->_resSystem->getResAnim("checker")->getFrame(0, 0);
        //Point itemSize(30, 30);// = _getItemRect().size;

        RectF srcRect = fr.getSrcRect();
        const Diffuse& df = fr.getDiffuse();
        srcRect.size.x = ns.x / (float)df.base->getWidth();
        srcRect.size.y = ns.y / (float)df.base->getHeight();
        RectF destRect = fr.getDestRect();
        destRect.size = ns;

        AnimationFrame cfr;
        cfr.init(0, df, srcRect, destRect, ns);

        setAnimFrame(cfr);


        /*
        spEventHandler bh = new EventHandler();

        bh->setCallbackEnter(CLOSURE(this, &TreeInspectorPreview::_onEvent));
        bh->setCallbackExit(CLOSURE(this, &TreeInspectorPreview::_onEvent));
        bh->setCallbackPressDown(CLOSURE(this, &TreeInspectorPreview::_onEvent));
        bh->setCallbackPressUp(CLOSURE(this, &TreeInspectorPreview::_onEvent));
        addEventHandler(bh);
        */
    }
开发者ID:poplax,项目名称:oxygine-framework,代码行数:59,代码来源:TreeInspectorPreview.cpp

示例6: GetParentRectangle

	RectF WidgetLayout::GetRect() const
	{
		RectF parentRect = GetParentRectangle();

		RectF rectangle(mData->offsetMin + mData->anchorMin*parentRect.Size(),
						mData->offsetMax + mData->anchorMax*parentRect.Size());

		return rectangle;
	}
开发者ID:zenkovich,项目名称:o2,代码行数:9,代码来源:WidgetLayout.cpp

示例7: RectFUnion

static RectF RectFUnion(RectF& r1, RectF& r2) {
    if (r2.IsEmptyArea())
        return r1;
    if (r1.IsEmptyArea())
        return r2;
    RectF ru;
    ru.Union(ru, r1, r2);
    return ru;
}
开发者ID:sambhare,项目名称:sumatrapdf,代码行数:9,代码来源:HtmlFormatter.cpp

示例8: deselect

void GridLabel::deselect(void)
{
    RectF r;
    r.setLeft(-2);
    r.setRight(-2);
    r.setTop(-1);
    r.setBottom(-1);
    m_pEditData->setCatchRect(r);
    update();
}
开发者ID:chocoball,项目名称:AnimationCreator,代码行数:10,代码来源:gridlabel.cpp

示例9: FillRectangle

void Graphics::FillRectangle(Brush* brush, const RectF& rc) {
	cairo_t* cg = reinterpret_cast<cairo_t*>(_private);
	cairo_save(cg);
	cairo_pattern_t* cp = reinterpret_cast<cairo_pattern_t*>(brush->_private);
	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,代码行数:10,代码来源:tjgraphics-cairo.cpp

示例10: GTEST_TEST

GTEST_TEST(RageRect, float_center)
{
	using namespace Rage;
	
	RectF test;
	
	RectF bigger{ -1, -1, 1, 1 };
	
	EXPECT_EQ(test.GetCenterX(), bigger.GetCenterX());
	EXPECT_EQ(test.GetCenterY(), bigger.GetCenterY());
}
开发者ID:dguzek,项目名称:stepmania,代码行数:11,代码来源:RageRectTest.cpp

示例11: DrawImage

void Graphics::DrawImage(Image* image, const RectF& 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::RectF(rc.GetLeft(), rc.GetTop(), rc.GetWidth(), rc.GetHeight()), 0.0f, 0.0f, (float)gdiImage->GetWidth(), (float)gdiImage->GetHeight(), Gdiplus::UnitPixel, ia);
    }
    else {
        g->DrawImage(gdiImage, ToGDIRect<RectF, Gdiplus::RectF>(rc));
    }
}
开发者ID:pixelspark,项目名称:corespark,代码行数:12,代码来源:tjgraphics-gdiplus.cpp

示例12: DrawRectangle

void Graphics::DrawRectangle(Pen* pen, const RectF& 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

示例13: selectionRectUV

void UnwrappedSurface::zoom() {
  if (!m_viewImage)
    return;
  RectF newView = selectionRectUV();
  if (newView.isEmpty())
    return;
  m_zoomStack.push(m_viewRect);
  m_viewRect = newView;
  updateView();
  emptySelectionRect();
  emit updateInfoText();
}
开发者ID:rosswhitfield,项目名称:mantid,代码行数:12,代码来源:UnwrappedSurface.cpp

示例14: DrawShadow

void CRevisionGraphWnd::DrawShadow (GraphicsDevice& graphics, const RectF& rect,
									Color shadowColor, NodeShape shape)
{
	// draw the shadow

	RectF shadow = rect;
	shadow.Offset (2, 2);

	Pen pen (shadowColor);
	SolidBrush brush (shadowColor);

	DrawShape (graphics, shadowColor, 1, &pen, shadowColor, &brush, shadow, shape);
}
开发者ID:fabgithub,项目名称:TortoiseGit,代码行数:13,代码来源:RevisionGraphDlgDraw.cpp

示例15: transformBox

RectF Transformation::transformedBounds() const
{
  // Get transformed corners
  Corners corners;
  transformBox(corners);

  // Create a union of all corners
  RectF bounds;
  for (int i=0; i<Corners::NUM_OF_CORNERS; ++i)
    bounds = bounds.createUnion(RectF(corners[i].x, corners[i].y, 1, 1));

  return bounds;
}
开发者ID:Censacrof,项目名称:aseprite,代码行数:13,代码来源:transformation.cpp


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