How to change color of Image at runtime

前端 未结 3 1926
情话喂你
情话喂你 2020-12-05 22:02

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

3条回答
  •  自闭症患者
    2020-12-05 22:49

    I am also facing trouble to under this question. after that based on the some information. I wrote the code manually.Now it works well. If you want to check.you can use it.

    code for change the background image during runtime in C#.net

    you can use simply this code. That is, ==>

    string str; 
    OpenFileDialog od = new OpenFileDialog(); 
    if (od.ShowDialog() == DialogResult.OK) 
    { 
        str = od.FileName;
        this.BackgroundImage=Image.FromFile(str); 
    }
    

提交回复
热议问题