将我的 PictureBox 设置为透明背景颜色并不能真正使其透明。漏洞?
这是我用非常简单易懂的术语表达的内容。
我的表单背景是蓝色。
我从表单背景创建了一个从白色到蓝色的渐变图像。这是为了给表单一个漂亮的渐变外观。我在表单中添加了一个图片框,并将该图像设置为图像。
我在渐变图片框顶部添加了一个带有徽标的图片框,但它“抓取”了表单背景颜色,并且不尊重我希望它抓取的透明背景图像。
所以:
蓝色表格 ->带渐变的巨大图片框 ->小图片框应该尊重渐变。
请帮忙!
Here's what I have in VERY simple easy to grasp terms.
My form background is Blue.
I created a gradient image from white to the Blue from the form background. This is to give the form a nice gradient look. I added a picturebox to my Form and set this image as the Image.
I added a picturebox with a Logo on top of the gradient Picturebox, but it's 'grabbing' the Form background color and not respecting the transparent background image I wanted it to grab.
So:
Blue Form -> Huge pictureBox with gradient -> Small picturebox thats supposed to respect the gradient.
Help please!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这可能是因为 PictureBox 不是一个控件容器。因此,这意味着当您将按钮图片框拖到主图片框上时,它实际上并不是图片框的子项,而是表单的子项。
您会注意到,如果您对面板执行相同的操作(将窗体设置为蓝色,面板背景图像,并将按钮图片框控件放在面板上),它将对面板控件显示透明。
为什么不设置 表单背景图片,避免使用巨大的图片框,并在表单本身上设置小图片框。
I think this might be as the PictureBox is not a control container. So this implies that when you drag the button picture box onto the main picture box, it is not actually a child of the picturebox, but rather of the form.
You would notice that if you were to do he same with a panel (set the form blue, panel background image, and place the button picture box control on the panel) it would show transparent to the panel control.
Why not rather set the Form BackgroundImage, avoid the Huge Picture Box, and set the small picture box on the form itself.