加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 有可能有两个重叠的PictureBox控件与透明图像?

发布时间:2020-12-15 17:41:27 所属栏目:百科 来源:网络整理
导读:参见英文答案 Transparent images with C# WinForms6 有两个重叠的 PictureBox controls,我试图使图片框的透明区域让下面的控件(在z顺序)是可见的. 即使在trying what Microsoft suggests之后,我也无法获得理想的结果. 这是我目前拥有的: 这就是我想要的:
参见英文答案 > Transparent images with C# WinForms6
有两个重叠的 PictureBox controls,我试图使图片框的透明区域让下面的控件(在z顺序)是可见的.

即使在trying what Microsoft suggests之后,我也无法获得理想的结果.

这是我目前拥有的:

这就是我想要的:

所以我的问题是:

任何方式实现我想要的结果与两个PictureBox控件(或以另一种方式)彼此重叠,让透明区域闪耀?

更新:

其实我用this answer的“Transparent images with C# WinForms”这个问题解决了这个问题.

解决方法

尝试这个
private void Form1_Load(object sender,EventArgs e)
{
  // Transparent background...  
  pictureBoxOverlay.BackColor = Color.Transparent;

  // Change parent for overlay PictureBox...
  pictureBoxOverlay.Parent    = pictureBoxMain;

 // Change overlay PictureBox position in new parent...
 // pictureBoxOverlay.Location  = new Point(0,0);
}

结果

llink

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读