【发布时间】:2012-04-22 10:25:45
【问题描述】:
我正在尝试将透明 Gif 图像添加到列表视图,我使用了以下代码 sn-p 添加 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
【问题讨论】:
标签: c# listview transparency gif