I am reading rgb values of each pixel in an application and storing it in an excel sheet.
when i select the file and run the application/..i get a message..that application is running at the bottom of screen...but actual excel sheet is filled with data..and even if i refresh it...it is not getting loaded(i mean the size does not change..)...the code is given below...plz chk
///some code
using (FileStream fs = File.Create("DEST.XLS"))
{
using (TextWriter w = new StreamWriter(fs))
{
Bitmap bm = new Bitmap(textBox1.Text);
for (i = 0; i < bm.Width; i++)
{
for (j = 0; j < bm.Height; j++)
{
Color pixelColor = bm.GetPixel(i, j);
b = pixelColor.R;
w.Write(b + " ");
c = pixelColor.G;
w.Write(c + " ");
d = pixelColor.B;
w.Write(d + " ");
w.Write("\r\n");
}
}
w.Close();
}
}
//DATA.XLS...GETS CREATED FROM WHERE WE SELECTE THE IMAGE.
//IS THE FORMAT WHICH I HAVE WRITTEN FOR EXCEL FILE CORRECT
..BECAUSE A MSG COMES..IT IS NOT IN CORRECT FORMAT...BUT I AM ABLE TO OPEN IT