[C#PictureBox使白色部分本身透明

问题描述 投票:0回答:1

我的图片框的行为就像是.PNG文件。

它使白色部分透明。甚至穿透“表单”,我就能看到表单((例如我的桌面,文件))的背后。但是在Form1.cs [Design]中似乎很正常。

            //card properties and design
            this.card.BackColor = System.Drawing.Color.Red;
            this.card.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("card.BackgroundImage")));
            this.card.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
            this.card.Location = new System.Drawing.Point(47, 92);
            this.card.Name = "card";
            this.card.Size = new System.Drawing.Size(103, 157);
            this.card.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            this.card.TabIndex = 2;
            this.card.TabStop = false;
            this.card.Visible = false;

Here is a picture of without running

Second picture that explains what's my problem

感谢您的帮助。

c# picturebox transparent
1个回答
0
投票

这看起来像是TransparencyKey被设置为Color.White。尝试清除它。

© www.soinside.com 2019 - 2024. All rights reserved.