Jump to content
Software FX Community

Printing of a gauge


User (Legacy)

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.

Link to comment
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.

Link to comment
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.

>

>

>

Link to comment
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.

>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...