Jump to content
Software FX Community
Sign in to follow this  
User (Legacy)

Printing of a gauge

Recommended Posts

Dear Olivier:

You can export the gauge in an image, and draw the image in the printer. The

following piece of code does the trick:

private void printDocument1_PrintPage(object sender,

System.Drawing.Printing.PrintPageEventArgs e) {

RadialGauge gauge = new RadialGauge();

using (MemoryStream stream = new MemoryStream()) {

gauge.Export(System.Drawing.Imaging.ImageFormat.Bmp, stream);

stream.Position = 0;

using (Bitmap bitmap = new Bitmap(stream)) {

e.Graphics.DrawImage(bitmap, Point.Empty);

}

}

}

private void button1_Click(object sender, EventArgs e) {

if (printDialog1.ShowDialog() == DialogResult.OK) {

printDocument1.Print();

}

}

"Oliver Denzel" <ODE@mik.de> wrote in message

news:8KGnSUaUGHA.232@webserver3.softwarefx.com...

> Hi!

>

> I want to print a gauge. How do I do this?

>

> Ciao

>

> Oli D.

Share this post


Link to post
Share on other sites

Dear Olivier:

You can export the gauge in an image, and draw the image in the printer. The

following piece of code does the trick:

private void printDocument1_PrintPage(object sender,

System.Drawing.Printing.PrintPageEventArgs e) {

RadialGauge gauge = new RadialGauge();

using (MemoryStream stream = new MemoryStream()) {

gauge.Export(System.Drawing.Imaging.ImageFormat.Bmp, stream);

stream.Position = 0;

using (Bitmap bitmap = new Bitmap(stream)) {

e.Graphics.DrawImage(bitmap, Point.Empty);

}

}

}

private void button1_Click(object sender, EventArgs e) {

if (printDialog1.ShowDialog() == DialogResult.OK) {

printDocument1.Print();

}

}

"Oliver Denzel" <ODE@mik.de> wrote in message

news:8KGnSUaUGHA.232@webserver3.softwarefx.com...

> Hi!

>

> I want to print a gauge. How do I do this?

>

> Ciao

>

> Oli D.

Share this post


Link to post
Share on other sites

Thank You!

Software FX Support wrote:

> Dear Olivier:

>

> You can export the gauge in an image, and draw the image in the printer. The

> following piece of code does the trick:

>

> private void printDocument1_PrintPage(object sender,

> System.Drawing.Printing.PrintPageEventArgs e) {

> RadialGauge gauge = new RadialGauge();

> using (MemoryStream stream = new MemoryStream()) {

> gauge.Export(System.Drawing.Imaging.ImageFormat.Bmp, stream);

> stream.Position = 0;

> using (Bitmap bitmap = new Bitmap(stream)) {

> e.Graphics.DrawImage(bitmap, Point.Empty);

> }

> }

> }

>

> private void button1_Click(object sender, EventArgs e) {

> if (printDialog1.ShowDialog() == DialogResult.OK) {

> printDocument1.Print();

> }

> }

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:8KGnSUaUGHA.232@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I want to print a gauge. How do I do this?

>>

>>Ciao

>>

>>Oli D.

>

>

>

Share this post


Link to post
Share on other sites

Thank You!

Software FX Support wrote:

> Dear Olivier:

>

> You can export the gauge in an image, and draw the image in the printer. The

> following piece of code does the trick:

>

> private void printDocument1_PrintPage(object sender,

> System.Drawing.Printing.PrintPageEventArgs e) {

> RadialGauge gauge = new RadialGauge();

> using (MemoryStream stream = new MemoryStream()) {

> gauge.Export(System.Drawing.Imaging.ImageFormat.Bmp, stream);

> stream.Position = 0;

> using (Bitmap bitmap = new Bitmap(stream)) {

> e.Graphics.DrawImage(bitmap, Point.Empty);

> }

> }

> }

>

> private void button1_Click(object sender, EventArgs e) {

> if (printDialog1.ShowDialog() == DialogResult.OK) {

> printDocument1.Print();

> }

> }

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:8KGnSUaUGHA.232@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I want to print a gauge. How do I do this?

>>

>>Ciao

>>

>>Oli D.

>

>

>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...