I have a picturebox that gets some output on similar to this:
e = New PrintPageEventArgs(PictureBox1.CreateGraphics, New Rectangle(New Point(25, 25), New Size(New Point(825, 1075))), e.PageBounds, e.PageSettings)
'Draw box
e.Graphics.DrawRectangle(Pens.Gray, 20, 30, e.PageBounds.Width - 100, e.PageBounds.Height - 130)
DrawnImage = PictureBox1.Image
I need to update it in the Paint event:
Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
PictureBox1.Image = DrawnImage
End Sub
The problem is DrawnImage is NULL. How do I capture the image?