private
void
PtDoc_PrintPage(
object
sender, PrintPageEventArgs e)
{
e.Graphics.Clear(Color.White);
e.Graphics.DrawString(
"标题:打印测试"
,
new
Font(
new
FontFamily(
"宋体"
), 40, FontStyle.Bold),
System.Drawing.Brushes.Red,
170, 10);
e.Graphics.DrawLine(Pens.Black, 20, 110, 800, 110);
e.Graphics.DrawString(
"内容"
,
new
Font(
new
FontFamily(
"宋体"
), 14, FontStyle.Bold),
System.Drawing.Brushes.Black,
20, 120,
new
StringFormat(StringFormatFlags.DirectionVertical));
e.Graphics.DrawString(
this
.txtName.Text,
new
Font(
new
FontFamily(
"宋体"
), 14, FontStyle.Bold),
System.Drawing.Brushes.Black,
20, 200);
Image imgsample = Image.fromFile(Path);
Point pt = Zoom(imgsample.Width, imgsample.Height, 200);
e.Graphics.DrawImage(imgsample, 20, 250, pt.X, pt.Y);
}