By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,980 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

Printing a Picture Box image to a printer...

P: n/a
Hi all,

Can anyone point me to a sample on how to print a picture box image to a
printer or do you have sample code that could show me?

Thanks,

Gary
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Gary,

Following is a code snippet illustrating how to print images of a picture box

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

PrintDialog1 = New PrintDialog

PrintDialog1.Document = PrintDocument1 'pbxLogo.Image

Dim r As DialogResult = PrintDialog1.ShowDialog

If r = DialogResult.OK Then

PrintDocument1.Print()

End If

End Sub

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

e.Graphics.DrawImage(pbxLogo.Image, 0, 0)

End Sub

HTH

Mona

"Gary" <sp**@spam.net.at> wrote in message news:3q******************@news-server.bigpond.net.au...
Hi all,

Can anyone point me to a sample on how to print a picture box image to a
printer or do you have sample code that could show me?

Thanks,

Gary

Nov 22 '05 #2

P: n/a
Thanks for that,

but I am getting an error see new post near top.

Gary
"Mona(Grapecity)" <mo**@discussions.microsoft.com> wrote in message news:uT**************@TK2MSFTNGP15.phx.gbl...
Hi Gary,

Following is a code snippet illustrating how to print images of a picture box

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click

PrintDialog1 = New PrintDialog

PrintDialog1.Document = PrintDocument1 'pbxLogo.Image

Dim r As DialogResult = PrintDialog1.ShowDialog

If r = DialogResult.OK Then

PrintDocument1.Print()

End If

End Sub

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

e.Graphics.DrawImage(pbxLogo.Image, 0, 0)

End Sub

HTH

Mona

"Gary" <sp**@spam.net.at> wrote in message news:3q******************@news-server.bigpond.net.au...
Hi all,

Can anyone point me to a sample on how to print a picture box image to a
printer or do you have sample code that could show me?

Thanks,

Gary

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.