|
/// <summary>
/// Compute every char position
/// </summary>
/// <param name="CharWidth"></param>
/// <param name="recChars"></param>
/// <param name="CharAngle"></param>
/// <param name="StartAngle"></param>
private void ComputeCharPos(
float[] CharWidth,
PointF[] recChars,
double[] CharAngle,
double StartAngle )
{
double fSweepAngle, fCircleLength;
//Compute the circumference
fCircleLength = _rectcircle.Width * Math.PI;
for( int i = 0; i < CharWidth.Length; i++ )
{
//Get char sweep angle
fSweepAngle = CharWidth[i] * 360 / fCircleLength;
//Set point angle
CharAngle[i] = StartAngle + fSweepAngle / 2;
//Get char position
if( CharAngle[i] < 270f )
recChars[i] = new PointF(
_rectcircle.X + _rectcircle.Width / 2
-(float)( _rectcircle.Width / 2 *
Math.Sin( Math.Abs( CharAngle[i] - 270 ) * Math.PI / 180 ) ) ,
_rectcircle.Y + _rectcircle.Width / 2
-(float)( _rectcircle.Width / 2 * Math.Cos(
Math.Abs( CharAngle[i] - 270 ) * Math.PI / 180 ) ) );
else
recChars[i] = new PointF(
_rectcircle.X + _rectcircle.Width / 2
+(float)( _rectcircle.Width / 2 *
Math.Sin( Math.Abs( CharAngle[i] - 270 ) * Math.PI / 180 ) ) ,
_rectcircle.Y + _rectcircle.Width / 2
-(float)( _rectcircle.Width / 2 * Math.Cos(
Math.Abs( CharAngle[i] - 270 ) * Math.PI / 180 ) ) );
//Get total sweep angle with interval space
fSweepAngle = ( CharWidth[i] + _letterspace ) * 360 / fCircleLength;
StartAngle += fSweepAngle;
}
}
共8页: 上一页 [1] [2] [3] [4] [5] 6 [7] [8] 下一页
|