Picture box printing

  • Thread starter Thread starter Max
  • Start date Start date
M

Max

Hello,

How would you print a picture box? I found sites online on printing a form and its basic controls but nothing on picture boxes.
Is it possible to print a logo for example from a C# .NET application?

Max
 
Hello,

How would you print a picture box? I found sites online on printing a form and its basic controls but nothing on picture boxes.
Is it possible to print a logo for example from a C# .NET application?

Max

Hi,

This seems to work: Again, I added a picturebox to a form and a button
in this case button6. My test form is getting cluttered :)

private void button6_Click(object sender, System.EventArgs e)
{
System.Drawing.Printing.PrintDocument pd = new
System.Drawing.Printing.PrintDocument();
pd.PrintPage+=new
System.Drawing.Printing.PrintPageEventHandler(pd_PrintPage);
pd.Print();
}

private void pd_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(pictureBox1.Image,0,0);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top