I would like to know is there any way by which we can change the Image color at runtime. for e.g lets say I am having a JPG bind to an Image control of ASP.Net. Next I am ha
You also try this for web (asp.net) , you can ignore the logic but can see what getpixel & setpixel doing
public string FileUpload( HttpPostedFileBase file )
{
Bitmap bmp = new Bitmap(file.InputStream);
string valid = "";
for(int i = 0; i < bmp.Width; i++) {
for(int j = 0; j < bmp.Height; j++) {
if(bmp.GetPixel(i , j).B < 20) {
if(bmp.GetPixel(i , j).B == bmp.GetPixel(i , j).G &&
bmp.GetPixel(i , j).B == bmp.GetPixel(i , j).R) {
valid = valid + bmp.GetPixel(i , j). + "
";
bmp.SetPixel(i , j , Color.DarkGreen);
}
}
}
}
SaveImage(bmp);
return valid;
}
private void SaveImage( Bitmap newbmp )
{
string path = Path.Combine(Server.MapPath("~/Images") , "ScaledImage.jpeg");
newbmp.Save(path , System.Drawing.Imaging.ImageFormat.Jpeg);
}