在WinForms中打印图形

时间:2013-05-17 21:35:16

标签: c# winforms graphics

我有一个类,创建返回Graphics。我想以我的主要形式打印此图形。如何System.Drawing.Printing.PrintPageEventArg.Graphics是只读的。如何打印Graphics而无法设置System.Drawing.Printing.PrintPageEventArg.Graphics

    public Graphics makeLabel()
    {

        Graphics label = Graphics.FromImage(makeBitMap());
        label.PageUnit = GraphicsUnit.Inch;
        label.DrawImage(Barcode,1, 200);
        label.DrawString("Do Not Seperate", makeFont(), Brushes.Black, 100, 2);
        label.DrawString("Choking Hazard", makeFont(), Brushes.Black, 200, 2);
        return label;

    }

0 个答案:

没有答案