[英]How can I print image big size in A4 paper c#
我想在我當前的代碼中以大尺寸打印圖片框的圖像,它以原始尺寸打印,我嘗試了以下代碼:
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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.