积极答复者
picturebox显示透明图片问题

问题
答案
-
他说的透明恐怕不是这个意思,AlphaBlend处理过的透明是整个图片的透明,不是那种背景透明图像,如果真是那样的话到也好办了,可以参考这里:http://www.cnblogs.com/fox23/archive/2007/10/01/windowsmobile-transparent-picture.html
全部回复
-
1.PictureBox不能真正的透明(让你看到图片轮廓以下的东西)
2.单一的颜色透明还是可以的:
public void Paint(Graphics gx)
{
if (!pushed || imageDown == null)
{
ImageAttributes attrib = new ImageAttributes();
Color color = GetTransparentColor(image);
attrib.SetColorKey(color, color);
gx.DrawImage(image, clientArea, 0, 0, clientArea.Width, clientArea.Height, GraphicsUnit.Pixel, attrib);
}
else
{
ImageAttributes attrib = new ImageAttributes();
Color color = GetTransparentColor(imageDown);
attrib.SetColorKey(color, color);
gx.DrawImage(imageDown, clientArea, 0, 0, clientArea.Width,clientArea.Height, GraphicsUnit.Pixel, attrib);
}
}private Color GetTransparentColor(Bitmap image)
{
return image.GetPixel(0, 0);
}希望对你有所帮助
Freesc
-
他说的透明恐怕不是这个意思,AlphaBlend处理过的透明是整个图片的透明,不是那种背景透明图像,如果真是那样的话到也好办了,可以参考这里:http://www.cnblogs.com/fox23/archive/2007/10/01/windowsmobile-transparent-picture.html