Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove white background color from Bitmap

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

like image 733
Ti Amo Laky Avatar asked Dec 21 '22 08:12

Ti Amo Laky


1 Answers

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.

like image 147
Kamil Nowak Avatar answered Jan 09 '23 04:01

Kamil Nowak