I want to print a Panel content but the result it's not high quality, I faced the same issue when I try to save a PictureBox image but I solve it with this Img.Setresolution(300, 300)
now I want to increase the quality of the result in any way ( also I tried to take a screenshot then store it in an image and print it I get a small image !! )
i tried this but it doesn't work for me :
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim tmpImg As New Bitmap(Panel1.Width, Panel1.Height)
Using g As Graphics = Graphics.FromImage(tmpImg)
g.CopyFromScreen(Panel1.PointToScreen(New Point(0, 0)), New Point(0, 0), New Size(Panel1.Width, Panel1.Height))
End Using
e.Graphics.DrawImage(tmpImg, 0, 0)
Dim aPS As New PageSetupDialog
aPS.Document = PrintDocument1
'Dim bm As New Bitmap(Panel1.Width, Panel1.Height)
'Panel1.DrawToBitmap(bm, New Rectangle(0, 0, Panel1.Width, Panel1.Height))
'e.Graphics.DrawImage(bm, 0, 0)
'Dim aPS As New PageSetupDialog
'aPS.Document = PrintDocument1
End Sub