Hi!
I was trying to make an application, in which you can save image and text together. I made my own file type .iaf and associated it with my app, but now i don't know how to save that image and text and then load it again. Please can anyone help?
Thank you
Save image and text
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.

FroglegRank #1,020 · 1.9K reputationPosted May 22, 2011, 10:27 AM EDT
Bitmap myBmp;
myBmp = new Bitmap(pictureBox1.Image);
myBmp.Save("whatever.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
to save text - using System.IO;
String yourString = "save me";
using (StreamWriter sw = new StreamWriter("fileName.txt"))
{
sw.WriteLine(yourString);
}
to load image
pictureBox1.Image = Image.FromFile("whatever.jpg");
to load text
using (StreamReader sr = new StreamReader("fileName.txt"))
{
yourString = sr.ReadLine();
}
Jan5 reputationPosted May 22, 2011, 11:06 AM EDT
FroglegRank #1,020 · 1.9K reputationPosted May 22, 2011, 11:36 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted May 22, 2011, 5:39 PM EDT
Jan5 reputationPosted May 23, 2011, 3:51 AM EDT