[英]How to start drawing printDocument from Right to Left in C# WInforms ?
如何從右到左開始繪制? الرقمالتسلسلي應該出現在右側
static void Main(string[] args)
{
PrintDocument p = new PrintDocument();
p.PrintPage += new PrintPageEventHandler(PrintPage);
p.Print();
}
static void PrintPage(object sender, PrintPageEventArgs e)
{
string drawString = "إختبار الرسم";
SolidBrush drawBrush = new SolidBrush(Color.Black);
Font drawFont = new System.Drawing.Font("Arail", 16);
RectangleF recAtZero = new RectangleF(0, 0, e.PageBounds.Width,
e.PageBounds.Height);
StringFormat drawFormat = new StringFormat();
drawFormat.FormatFlags = StringFormatFlags.DirectionRightToLeft;
e.Graphics.DrawString(drawString, drawFont, drawBrush, recAtZero,
drawFormat);
RectangleF recAtGreaterThantZero = new RectangleF(300, 0,
e.PageBounds.Width, e.PageBounds.Height);
e.Graphics.DrawString(drawString, drawFont, drawBrush,
recAtGreaterThantZero, drawFormat);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.