User (Legacy) Posted March 27, 2006 Report Share Posted March 27, 2006 Hi! I want to print a gauge. How do I do this? Ciao Oli D. Link to comment Share on other sites More sharing options...
User (Legacy) Posted March 27, 2006 Author Report Share Posted March 27, 2006 Hi! I want to print a gauge. How do I do this? Ciao Oli D. Link to comment Share on other sites More sharing options...
Software FX Posted March 27, 2006 Report Share Posted March 27, 2006 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 More sharing options...
Software FX Posted March 27, 2006 Report Share Posted March 27, 2006 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 More sharing options...
User (Legacy) Posted March 29, 2006 Author Report Share Posted March 29, 2006 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 More sharing options...
User (Legacy) Posted March 29, 2006 Author Report Share Posted March 29, 2006 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.