void doRoundedRects(CGContextRef context)
{
	CGRect rect = {{10., 10.}, {210., 150.}};
	float ovalWidth = 100., ovalHeight = 100.;
	CGContextSetLineWidth(context, 2.);
	CGContextBeginPath(context);
	addRoundedRectToPath(context, rect, ovalWidth, ovalHeight);
	CGContextSetRGBStrokeColor(context, 1., 0., 0., 1.);
	CGContextDrawPath(context, kCGPathStroke);
}
Пример #2
0
/*
fillRoundedRect : fills a rounded rectangle with the current fill color

Parameter Descriptions
rect : The CG rectangle that defines the rectangle's boundary.
ovalWidth : The width of the CG rectangle that encloses the rounded corners
ovalHeight : The height of the CG rectangle that encloses the rounded corners
context : The CG context to render to.
*/
void fillRoundedRect(CGContextRef context, CGRect rect, float ovalWidth, float
					 ovalHeight)
{
	// Signal the start of a path
	CGContextBeginPath(context);
	// Add a rounded rect to the path
	addRoundedRectToPath(context, rect, ovalWidth, ovalHeight);
	// Fill the path
	CGContextFillPath(context);
}