您的位置:首页 > 其它

GDI+ 绘制多行文本

2011-07-30 01:21 239 查看
绘制多行文本,如图:

View Code //private void Form1_Paint(object sender, PaintEventArgs e)
//{
// Graphics g = e.Graphics;
// FontFamily ff = new FontFamily(GenericFontFamilies.Serif);
// Font f = new Font(ff, 12, FontStyle.Italic|FontStyle.Bold|FontStyle.Strikeout|FontStyle.Underline) ;

// string str = "Heightfjdfjdkkkkkkhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkkkkkkkkkfjdkkkkkkkkkkkkkkkkjf" + f.Height;
// //不添加而外的高度
// SizeF sf = g.MeasureString(str, f, int.MaxValue, StringFormat.GenericTypographic);

// Rectangle r = new Rectangle(0, 0, 200, f.Height * 6);
// g.DrawRectangle(Pens.Red,r);
// g.DrawString(str, f, Brushes.Blue, r, StringFormat.GenericTypographic);

//}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: