0
我有一个Winform应用程序创建标志。除了当我打印时,一切正常,看起来很好。我有一个图像,其上放置了文本框。它们在我的计算机上可见,但在打印时不会显示。我假设在某种程度上,当我打印图像变得“从前到后”。Winform文本框不在打印图像
下面是我的打印功能:
private void btnPrint_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(PrintImage);
pd.Print();
}
void PrintImage(object o, PrintPageEventArgs e)
{
int x = SystemInformation.WorkingArea.X;
int y = SystemInformation.WorkingArea.Y;
int width = this.Width;
int height = this.Height;
Rectangle bounds = new Rectangle(x, y, width, height);
Bitmap img = new Bitmap(width, height);
this.DrawToBitmap(img, bounds);
Point p = new Point(100, 100);
e.Graphics.DrawImage(img, p);
}
我不知道肯定的是,在打印功能是什么原因,但我想不出别的。