Hi Lars,
First store your output to a Bitmap (using Graphics.FromImage),
then simply save the file using Image.Save(filename, ImageFormat.Png)
> Hi!
> A have developed a windows app in VB.NET that has some printing of charts
> and such stuff. Is there an easy way to save the outprint in an PNG-file
> instead? I want exactly the same look in the image as in the outprint.

Signature
Happy Coding!
Morten Wennevik [C# MVP]
LarsJ - 22 Mar 2005 14:33 GMT
Hi!
I have existing printings to paper with mixed drawings and 3rd party charts.
I want the same outprint to an image instead of paper. I would like an easy
way to redirect the printer graphics to an image.
You suggest Graphics.FromImage() which creates a graphics from an existing
image. I want the opposite: create an image from the graphics, but
unfortunately there is no Graphics.ToImage(). Or did I miss something?
> Hi Lars,
>
[quoted text clipped - 5 lines]
> > and such stuff. Is there an easy way to save the outprint in an PNG-file
> > instead? I want exactly the same look in the image as in the outprint.
Morten Wennevik - 22 Mar 2005 16:49 GMT
Create a Bitmap, typically the size of your display control.
Graphics g = Graphics.FromImage(Bitmap);
Use this graphics object for drawing (pass it to an OnPaint, PrintPage
event etc). Instead of drawing to screen the drawing will be stored in
the Bitmap. The procedure is the same as you would do when printing to
paper.
> Hi!
> I have existing printings to paper with mixed drawings and 3rd party
[quoted text clipped - 22 lines]
>> Happy Coding!
>> Morten Wennevik [C# MVP]

Signature
Happy Coding!
Morten Wennevik [C# MVP]
LarsJ - 01 Apr 2005 08:09 GMT
Thanks, I got it working!
> Create a Bitmap, typically the size of your display control.
>
[quoted text clipped - 31 lines]
> >> Happy Coding!
> >> Morten Wennevik [C# MVP]