【问题标题】:How can I print image big size in A4 paper c#如何在 A4 纸 c# 中打印大尺寸的图像
【发布时间】:2020-06-04 02:26:09
【问题描述】:

我想在当前代码中以大尺寸从图片框中打印图像,并以原始尺寸打印, 我尝试了以下代码:

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

如何以至少两倍的原始尺寸打印更大尺寸的图像?

【问题讨论】:

    标签: c# .net picturebox


    【解决方案1】:

    绘制页面边缘的图像

    e.Graphics.DrawImage(bm, args.MarginBounds);

    在页面的整个区域中绘制图像

    e.Graphics.DrawImage(bm, args.PageBounds);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-04
      • 1970-01-01
      • 2014-09-04
      • 2019-08-18
      • 1970-01-01
      • 2010-10-29
      • 2023-04-03
      • 1970-01-01
      相关资源
      最近更新 更多