2013-04-10 4 views

답변

4

당신은 비트 맵 클래스에 MakeTransparent 방법을 사용할 수 있습니다보십시오. 그래서

Bitmap b = new Bitmap("img.jpg") 
b.MakeTransparent(Color.White); 
pictureBox.Image = b; 

같은 것입니다하지만 난 당신이 이유 대신 JPG의 PNG를 사용하는 것이 좋습니다 :이 나 같은 이미지)의 네이티브 지원을 위해이 같은 이미지에 대한) 더 나은 품질() C) 작은 크기 투명 한 배경.

차이점은 무엇입니까? http://www.bing.com/search?setmkt=en-US&q=PNG+vs+JPG

1

Bitmap bmp = (Bitmap)Image.FromFile(@"C:\your_k.bmp"); //Load a bitmap from file 
    bmp.MakeTransparent(Color.White) //Do the work! 
    //if you have a varient color combination you can use RGB Combination as follows 
    //bmp.MakeTransparent(Color.FromArgb(255, 255 255)); // (255 255, 255) is white! 
    this.pictureBox1.Image = bmp; 
    this.pictureBox1.BackColor = Color.Transparent; //makes humbly only your object! 
관련 문제