Save Drawing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I drawed a little FlowChart (with some Rectangles and Lines) in the OnPaint
event of a Form. How can I save this Chart for example as a jpg-file or
bmp-file?

patrick
 
You might want to draw on an Image object rather then the form. Then you
can save the Image using methods.
 
Hello,

I tried it with something like this:

GraphicsUnit units = GraphicsUnit.Pixel;
private Image newImage = Image.FromFile("SampImage.jpg");


formGraphics.DrawImage(newImage, drawRect,x,y,width,height,units);

//drawRect is the Rectangle, and I have manually created the SampImage.jpg
and put it in the project directory. But when I execute application I always
get a FileNotFoundException. Does anybody know what went wrong here? :(

patrick
 
Hi Patrick,

Did you put the file in the root project directory (with the code files)
or the binary directory with the executable. With your code it would look
for the file in bin/debug or bin/release.
 
Back
Top