Code example for Paint

Methods: getTextBounds, measureText

0
		// top. 
 
		canvas.drawCircle(pointerPosition[0], pointerPosition[1],
				(float) (mPointerRadius / 1.2), mPointerColor);
		Rect bounds = new Rect();
		textPaint.getTextBounds(text, 0, text.length(), bounds);
		// canvas.drawCircle(mColorWheelRectangle.centerX(), 
		// mColorWheelRectangle.centerY(), (bounds.width() / 2) + 5, 
		// mCircleTextColor); 
		if (show_text)
			canvas.drawText(
					text,
					(mColorWheelRectangle.centerX())
							- (textPaint.measureText(text) / 2),
					mColorWheelRectangle.centerY() + bounds.height() / 2,
					textPaint);
 
		// last_radians = calculateRadiansFromAngle(mAngle); 
 
	}