I created a user control and a background image. I use the printDocument component and then drawToBitmap to print.
The issue is that there are areas of the bitmap which aren't printing correctly (blank).
When I remove the background image, the print-out looks just the way I expect it to. With the background image in place, printing is whacky as I mentioned above.
Any ideas what the problem may be?
Here's my code:
Code:Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage ' Print only panel 1 and its contents Dim b As New Bitmap(Panel1.ClientSize.Width, Panel1.ClientSize.Height) Panel1.DrawToBitmap(b, Panel1.ClientRectangle) e.Graphics.DrawImage(b, New Point(0, 0)) End Sub




Reply With Quote