我正在开发 VS 2008 中的表单应用程序,并且在重叠两个图像时卡住了。这些图像是透明的,因此它们应该能够混合在一起,但结果如下所示:
我看过与此类似的帖子,但似乎无法弄清楚为什么这两张图片不能融合在一起。以下是我如何处理的代码:
InitializeComponent();
this.Width = 700;
this.Height = 768;
Bitmap BackgroundImg = new Bitmap(@"C:\Users\Classic.bmp");
Bitmap img = new Bitmap(@"C:\Users\Lime.bmp");
backImage.Image = BackgroundImg;
backImage.Width = 700;
backImage.Height = 768;
backImage.Location = new Point(0, 0);
overImage.Image = img;
overImage.Width = img.Width;
overImage.Height = img.Height;
overImage.Parent = backImage;
//overImage.BackColor = Color.Transparent;
overImage.Location = new Point(200, 200);
backImage 和 overImage 是图片框