예제 #1
0
//-----------------------------------------------------------------------------
void D2DDrawContext::drawArc (const CRect& _rect, const float _startAngle, const float _endAngle, const CDrawStyle drawStyle)
{
    CGraphicsPath* path = createGraphicsPath ();
    if (path)
    {
        path->addArc (_rect, _startAngle, _endAngle, false);
        if (drawStyle == kDrawFilled || drawStyle == kDrawFilledAndStroked)
            drawGraphicsPath (path, kPathFilled);
        if (drawStyle == kDrawStroked || drawStyle == kDrawFilledAndStroked)
            drawGraphicsPath (path, kPathStroked);
        path->forget ();
    }
}
예제 #2
0
	void draw (CDrawContext* context)
	{
		CGraphicsPath* path = context->createGraphicsPath ();
		if (path)
		{
			CRect r (getViewSize ());
			r.inset (5, 5);
			path->beginSubpath (CPoint (r.left + r.getWidth () / 2, r.top));
			path->addLine (CPoint (r.left, r.bottom));
			path->addLine (CPoint (r.right, r.bottom));
			path->closeSubpath ();
			setupLineStyle (context);
			context->drawGraphicsPath (path, CDrawContext::kPathStroked);
			path->forget ();
		}
		setDirty (false);
	}