mobile图片的透明处理

一般有两种方法

1.设置属性

ImageAttributes attrib = new ImageAttributes(); Color color = image.GetPixel(0, 0); attrib.SetColorKey(color, color); gx.DrawImage(image, clientArea, 0, 0, clientArea.Width, clientArea.Height, GraphicsUnit.Pixel, attrib);

2.使用插件

 AlphaImage c = AlphaImage.CreateFromFile(path + @"/Images/" + dr["norm"].ToString()); Bitmap temp = new Bitmap(path + @"/Images/" + dt.Rows[0]["norm"].ToString()); normsize.Width = temp.Width; normsize.Height = temp.Height; c.Draw(gxBuffer, new Rectangle(((iconover.Width - normsize.Width) / 2) + moveX + offx, this.Height - iconover.Height, normsize.Width, normsize.Height));

你可能感兴趣的:(c,image,mobile,Path)