4

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

这是代码:

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);
}
4

1 回答 1

5

您需要实际绘制图像:

private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
  e.Graphics.DrawImage(picpdf417.Image, Point.Empty);
}
于 2013-04-01T15:55:51.660 回答