Printing a Graphics Object

  • Thread starter Thread starter ECVerify.com
  • Start date Start date
E

ECVerify.com

I have a Graphics object in a control that has an image I want to
print...I want to print my already made Graphics object that I use in
a control, I try this

Private Sub pd_PrintPage(sender As Object, e As PrintPageEventArgs)
e.Grahpics = MyControl.MyGraphics
End Sub


When I do the problem is that e.Grahpics is read only.

How do I print what I already have ib memory without redrawing
everything on the e.Grahpics object?

Thanks, Ed,
 
Hi,

I post a procedure that gets a windows or controls image from its
handle.

http://www.vb-helper.com/howto_net_get_window_image.html

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

e.Graphics.DrawImage(GetWindowPicture(PictureBox1.Handle.ToInt32), 0, 0)

End Sub



Ken
 
Ken Tucker said:
Hi,

I post a procedure that gets a windows or controls image from its
handle.

http://www.vb-helper.com/howto_net_get_window_image.html

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

e.Graphics.DrawImage(GetWindowPicture(PictureBox1.Handle.ToInt32), 0, 0)

End Sub



Ken

Thanks Ken,

Yes that is basically what I did,

Thanks again for your input,

Ed,
 
Back
Top