|
/// <summary>
/// Draw every rotated character
/// </summary>
/// <param name="g"></param>
/// <param name="_text"></param>
/// <param name="_angle"></param>
/// <param name="_PointCenter"></param>
private void DrawRotatedText( Graphics g, string _text, float _angle, PointF _PointCenter )
{
// Init format
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
// Create graphics path
GraphicsPath gp = new GraphicsPath( System.Drawing.Drawing2D.FillMode.Winding );
int x = (int)_PointCenter.X;
int y = (int)_PointCenter.Y;
// Add string
gp.AddString( _text, _font.FontFamily, (int)_font.Style,
_font.Size, new Point( x, y ), sf );
// Rotate string and draw it
Matrix m = new Matrix();
m.RotateAt( _angle, new PointF( x,y ) );
g.Transform = m;
g.DrawPath( new Pen( _color), gp );
g.FillPath( new SolidBrush( _fillcolor ), gp );
}
}
public enum Char_Direction
{
Center = 0,
OutSide = 1,
ClockWise = 2,
AntiClockWise = 3,
}
}
共8页: 上一页 [1] [2] [3] [4] [5] [6] [7] 8 下一页
|