S
Sirin Azazi
i am trying to convert an image into grayscale format. but i have a problem
saving the bmp file after the process.here the code;
for (int y = 0; y < Height; y++)
{
for (int x = 0; x < Width; x++)
{
Color c = img1.GetPixel(x, y);
int pxl= (int)(c.R * 0.3 + c.G * 0.59 + c.B * 0.11);
img1.SetPixel(x, y, Color.FromArgb(pxl, pxl, pxl));
img1.Save(filepath);
}
}
but i get an exception;
"External exception was unhandled.
A generic error occurred in GDI+. "
where s the problem?
thanks.
saving the bmp file after the process.here the code;
for (int y = 0; y < Height; y++)
{
for (int x = 0; x < Width; x++)
{
Color c = img1.GetPixel(x, y);
int pxl= (int)(c.R * 0.3 + c.G * 0.59 + c.B * 0.11);
img1.SetPixel(x, y, Color.FromArgb(pxl, pxl, pxl));
img1.Save(filepath);
}
}
but i get an exception;
"External exception was unhandled.
A generic error occurred in GDI+. "
where s the problem?
thanks.