如何在 A4 纸 C# 中打印大尺寸图像
How can I print image big size in A4 paper c#
我想在当前代码中以大尺寸打印 picturebox 中的图像,它以原始尺寸打印,
我尝试了以下代码:
private void btnID_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
PrintDocument pdoc = new PrintDocument();
pdoc.PrintPage += doc_printID;
pd.Document = pdoc;
if (pd.ShowDialog() == DialogResult.OK)
pdoc.Print();
}
private void doc_printID(object sender, PrintPageEventArgs e)
{
Bitmap bm = new Bitmap(pictureIDIQAMA.Width, pictureIDIQAMA.Height);
pictureIDIQAMA.DrawToBitmap(bm, new Rectangle(0, 0, pictureIDIQAMA.Width, pictureIDIQAMA.Height));
e.Graphics.DrawImage(bm, 200,400);
bm.Dispose();
}
如何以至少两倍原始尺寸打印更大尺寸的图像?
绘制页面边缘内的图像
e.Graphics.DrawImage(bm, args.MarginBounds);
或
在整个页面区域绘制图像
e.Graphics.DrawImage(bm, args.PageBounds);
我想在当前代码中以大尺寸打印 picturebox 中的图像,它以原始尺寸打印, 我尝试了以下代码:
private void btnID_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
PrintDocument pdoc = new PrintDocument();
pdoc.PrintPage += doc_printID;
pd.Document = pdoc;
if (pd.ShowDialog() == DialogResult.OK)
pdoc.Print();
}
private void doc_printID(object sender, PrintPageEventArgs e)
{
Bitmap bm = new Bitmap(pictureIDIQAMA.Width, pictureIDIQAMA.Height);
pictureIDIQAMA.DrawToBitmap(bm, new Rectangle(0, 0, pictureIDIQAMA.Width, pictureIDIQAMA.Height));
e.Graphics.DrawImage(bm, 200,400);
bm.Dispose();
}
如何以至少两倍原始尺寸打印更大尺寸的图像?
绘制页面边缘内的图像
e.Graphics.DrawImage(bm, args.MarginBounds);
或
在整个页面区域绘制图像
e.Graphics.DrawImage(bm, args.PageBounds);