gpt4 book ai didi

C# PrintDocument 打印空白页。为什么?

转载 作者:行者123 更新时间:2023-11-30 15:34:48 57 4
gpt4 key购买 nike

我有以下图片框,我用条形码填充然后尝试打印。

代码如下:

private void button1_Click(object sender, EventArgs e)
{

printDocument1.OriginAtMargins = true;
printDocument1.DocumentName = "TEST IMAGE PRINTING";

printDialog1.Document = printDocument1;
printDialog1.ShowDialog();
printDocument1.Print();

}


private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
System.Drawing.Graphics formGraphics = System.Drawing.Graphics.FromImage(picpdf417.Image);
}

最佳答案

您需要实际绘制图像:

private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
e.Graphics.DrawImage(picpdf417.Image, Point.Empty);
}

关于C# PrintDocument 打印空白页。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15746729/

57 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com