透明背景图像绘制(C#)ImageAttributes vAttr = new ImageAttributes(); //vAttr是关键 //图像中与0,0那点相同的颜色要变成透明 vAttr.SetColorKey(((Bitmap)pictureBox1.Image).GetPixel(0, 0), ((Bitmap)pictureBox1.Image).GetPixel(0, 0)); //绘制透明的图像 e.Graphics.DrawImage(pictureBox1.Image , new Rectangle(10, 10, pictureBox1.Width, pictureBox1.Height) , 0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height , GraphicsUnit.Pixel , vAttr); 完整的例子程序下载(Sample00002.rar)版权声明:本文为cento123原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/cento123/article/details/6279467