How to remove white background color from Bitmap

与世无争的帅哥 提交于 2019-12-10 16:29:13

问题


I want to remove the white background color in a bitmap

Bitmap capcha = new Bitmap("C:/image.jpg");
pictureBox1.Image = capcha;

but I want to display in my pictureBox1 just the image without white that exists in the background


回答1:


try to set transparency in capcha like this:

Bitmap capcha = new Bitmap(@"C:/image.jpg");
capcha.MakeTransparent(Color.White);
pictureBox1.Image = capcha;

I hope it is what u need.



来源:https://stackoverflow.com/questions/15375453/how-to-remove-white-background-color-from-bitmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!