全部。
我会使用 PrintPreviewControl 来预览带有背景的文档。但我不希望背景被打印出来。
这是我的代码:
private void button1_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
// This background should not print out, but could view in preview
e.Graphics.DrawImage(new Bitmap(Foobar.Properties.Resources.bg), new Point());
string text = "This text to be printed. ";
e.Graphics.DrawString(text, new Font("Georgia", 35, FontStyle.Bold),
Brushes.Black, 10, 10);
}
非常感谢!