1 Replies - 964 Views - Last Post: 27 October 2012 - 07:17 AM Rate Topic: -----

#1 KasunL   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 87
  • Joined: 11-April 11

Image printing quality

Posted 26 October 2012 - 07:00 PM

Hi!

So i print an image like this:

private void PrintNow()
        {

            Rectangle bounds = this.Bounds;
            using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
            {
                using (Graphics g = Graphics.FromImage(bitmap))
                {
                    g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
                }
                bitmap.Save("ServiceRep.bmp", ImageFormat.Bmp);
            }

            PrintDialog printdlg = new PrintDialog();
            PrintDocument pdoc = new PrintDocument();
            printdlg.Document = pdoc;
            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);
            DialogResult result = printdlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                pdoc.Print();
            }
        }

        void pdoc_PrintPage(object sender, PrintPageEventArgs e)
        {
            try
            {
                System.Drawing.Image img = System.Drawing.Image.FromFile("ServiceRep.bmp");
                Point loc = new Point(100, 100);
                e.Graphics.DrawImage(img, loc);
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }



but when i print it, the image quality is low. Any idea for me to fixing that?

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Image printing quality

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: Image printing quality

Posted 27 October 2012 - 07:17 AM

What is the size of the image in pixels?
What is the DPI resolution of the printer?
What is the physical size of the print in inches?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1