Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everybody,

My Screen DPI is 96 and my printer DPI is 600 and I am trying to print an Image. It prints successfully but Image quality is not fine.

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)

   e.Graphics.DrawImage(Image,0,0, Image.Width, Image.Height)

End Sub

So, please help me. How can I improve the quality of Image?

Updated 18-Nov-10 6:26am

You cannot change the DPI of the printer, well, not as low as you want it. You can magnify the image to scale up the DPI, but the more you do, the fuzzier the image is going to be. You simply do not have enough data in the original image to maintain quality the larger you want to print it.
Share this answer

You can use this to improve the quality of an Image:

Imports System.Drawing.Drawing2D

e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality
e.Graphics.CompositingQuality = CompositingQuality.HighQuality
To set the resolution you can use this:
Dim bmp As New Bitmap(Image)
bmp.SetResolution(dpiX, dpiY)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900