I have a sticker I want to print from my form but I cant seem to figure out how to print the text overlaying on the picture box, and I can only print the picture itself. So basically what I wanted was the area of the picture box and the labels on top of the picturebox to be shown in the printout.
I have this so far, not sure how to also represent all labels within the picturebox area.
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
PrintDialog1.Document = PrintDocument1
PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings
PrintDialog1.AllowSomePages = True
If PrintDialog1.ShowDialog = DialogResult.OK Then
PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings
PrintDocument1.Print()
End If
End Sub
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim newMargins = New System.Drawing.Printing.Margins
newMargins = New System.Drawing.Printing.Margins(0.2, 0.2, 0.2, 0.2)
PrintDocument1.DefaultPageSettings.Margins = newMargins
e.Graphics.DrawImage(PictureBox1.Image, 0, 0)
End Sub