//Image img = Image.FromFile(@"e:\f.png");
Bitmap img = new System.Drawing.Bitmap(300, 300);
img.MakeTransparent();
Graphics g = Graphics.FromImage(img);
//Color bc=Color.(255,0,255);
//g.Clear(ColorTranslator.FromHtml("#00FF00"));
//g.Clear(Color.Transparent);
Font font = new Font("Arial", 20, FontStyle.Bold);
Color c = Color.FromArgb(50,255,0,0);
//LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, img.Width, img.Height), c, c, 1.2f, true);
SolidBrush brush = new SolidBrush(c);
g.DrawString("ssssss", font, brush, 150, 160);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
img.Save("xx.png", System.Drawing.Imaging.ImageFormat.Png);
以上代码是生成一个背景透明上面文字 alpha 50 红色的png图
在win 7 和 win7 下的 server 2003 VPC虚拟机 中生成的图片 背景透明文字黑色不透明,
在win7 下的 server 2003 VM 虚拟机中生成的图片背景透明,文字红色 半透明,这是正常的。
然后我在xp 和 xp下的 server 2003 VPC 虚拟机 中测试了下 图片还是正常的
这是怎么回事 。有什么解决方案可让片在win7 xp 以及 win7 下的VPC 虚拟机生成正常的图片