我有一个类,创建返回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;
}