简体   繁体   中英

How can I print image big size in A4 paper c#

I want to print image from picturebox in big size in my current code its print in original size , I tried the following code :

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

How can I print the image in bigger size at lease double original size ?

To draw the image that is within the margin of your page

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

or

To draw the image across total area of the page

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM