微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

参见英文答案 > 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

原文地址:https://www.jb51.cc/csharp/96603.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐