How to remove white background color from Bitmap

2019-06-26 08:59发布

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条回答
爷、活的狠高调
2楼-- · 2019-06-26 09:42

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.

查看更多
登录 后发表回答