2012-04-10 4 views
0

투명 GIF 이미지를 목록보기에 추가하려고하는데 다음 코드 스 니펫 을 사용하여 gif 이미지를 추가했습니다.목록보기에 투명 Gif 이미지 추가 #

// control as ListView 
void AddGiftoListView(Control parent) 
{ 
    Bitmap img = (Bitmap)Properties.Resources.madLoader; // Transparent gif image 
    Size sz = img.Size; 
    PictureBox pbGif = new PictureBox(); 
    pbGif.Size = img.Size; 
    pbGif.Image = img; 

    parent.Controls.Add(pbGif); 
    Point p = new Point(1, 1); 
    pbGif.Location = p; 
    pbGif.Show(); 
} 

그러나 gif는 투명하지 않습니다. 목록보기가 텍스트로 채워지면 흰색 배경이있는 gif를 볼 수 있습니다. 이 문제를 해결하는 방법이 있습니까?

감사합니다, 쉬주 P K

답변

0

흰색

this.TransparencyKey = Color.White; 
로 양식의 TransparencyKey을보십시오