smsurendar

How do store a form with own extension



Re: Windows Forms General Save with own extension

Eli Gazit

Could you please give more information about what you are trying to do






Re: Windows Forms General Save with own extension

smsurendar

i drew some graphics in form ,that i was done in paint event... i want to store the form information to my own extension name... If i want to retrive the information i will use filename with extension...





Re: Windows Forms General Save with own extension

Eli Gazit

What do you mean by 'store the form information' What information do you want to save

There are many ways to save information.... You can use File.WriteText(...) to save string with the information and later use File.ReadAllText(...) to get the string and do with it what ever you want.

You can save information using the Settings window. You can save information using XML or serialization.

The question is, what do you want to save






Re: Windows Forms General Save with own extension

smsurendar

i will save graphics(lines,bitmaps)





Re: Windows Forms General Save with own extension

Eli Gazit

On the draw method, you can create a new image:

Image image = new Bitmap(this.Width, this.Height);

Graphics g = Graphics.FromImage(image);

And than write the drawing command to g :

g.DrawLine(...)

g.DrawImage(...)

After that, save the Image:

image.Save(...)