日期:2014-05-17 浏览次数:22071 次
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
//Create font and brush
Font drawFont = new Font("黑体", 20);
Font drawFont1 = new Font("黑体", 16);
SolidBrush drawBrush = new SolidBrush(Color.Black);
Image memoryImage = Image.FromFile(Application.StartupPath + @"\back.jpg"); //背景格式文件路径
e.Graphics.DrawImage(memoryImage, 0, 0, 825, 1178);
Image memoryImage1 = Image.FromFile(Application.StartupPath + @"\top.jpg"); //测试头像文件路径
e.Graphics.DrawImage(memoryImage1, 583, 200, 170, 240);
//基本信息
e.Graphics.DrawString(name, drawFont, drawBrush, 150, 218);//这些数据位置全是一点点试出来的,不科学啊
e.Graphics.DrawString(sex, drawFont, drawBrush, 460, 218);
e.Graphics.DrawString(unit, drawFont, drawBrush, 150, 276);
e.Graphics.DrawString(site, drawFont, drawBrush, 150, 334);
e.Graphics.DrawString(Tel, drawFont, drawBrush, 150, 392);
}