本文介绍了打印时进行文字包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Draw String中应用文本warpping?
how to text warpping apply in Draw String??
推荐答案
PrintDocument p = new PrintDocument();
p.PrintPage += delegate(object sender, PrintPageEventArgs e)
{
int i=0;
foreach (string s in arr)
{
i++;
e.Graphics.DrawString(s, new Font("Times New Roman", 12), new SolidBrush(Color.Black), new ReftangleF(0,0,p.Width,p.Height));
}
};
try
{
p.Print();
}
catch (Exception ex)
{
throw new Exception("Exception Occured While Printing", ex);
}
Graphics.DrawString Method (String, Font, Brush, RectangleF, StringFormat)
并指定矩形,它将包裹在矩形内。
查看 []
希望有所帮助
Milind
and specify the rectangle,it will wrap inside the rectangle.
Check http://msdn.microsoft.com/en-us/library/21kdfbzs.aspx[^]
Hope that helps
Milind
这篇关于打印时进行文字包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!