首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PictureBox使白色零件本身透明

PictureBox使白色零件本身透明
EN

Stack Overflow用户
提问于 2020-02-12 04:00:07
回答 1查看 38关注 0票数 0

我的picturebox看起来像是.PNG文件。

它使白色的部分透明。

甚至穿透“表单”,我就能看到表单背后的内容(比如我的桌面,文件)。

但在Form1.cs设计中,这似乎是正常的。

代码语言:javascript
复制
//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;

下面是一张没有运行的图片:

第二张图片解释了我的问题所在:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-12 04:20:00

这看起来像是一个被设置为TransparencyKeyColor.White。试着清理一下。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60180921

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档