Windows窗体玻璃效果,使ImageBox透明

编程入门 行业动态 更新时间:2024-10-19 18:18:32
本文介绍了Windows窗体玻璃效果,使ImageBox透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个Windows窗体应用程序,并且我已使用DwmExtendFrameIntoClientArea将窗口的框架扩展到工作区中以获得玻璃效果.

I have a windows form application, and I have extended the window's frame into the client area using DwmExtendFrameIntoClientArea to get the glass effect.

现在,我试图在图片框中显示透明的PNG图像,但是背景显示为白色而不是玻璃效果.如何使图像显示为透明,这样我只能看到圆角的灰色矩形而不是白色背景.

Now I'm trying to show a transparent PNG image in a picture box, however the background shows up as white instead of the glass effect. How can i make the image show as transparent so that i only see the rounded gray rectangle and not the white background.

我的屏幕截图如下.谢谢.

My screenshot is below. Thanks.

推荐答案

好吧,这是一种易于解决的winforms问题.您必须执行的操作,就像blam所说的将透明键设置为诸如:R:1,G:2,B:3 ...这样可使您用透明颜色绘制的表单中的所有内容都变得透明...然后您需要做的就是将图像框的背景色设置为该颜色. .并且它应该透明地绘制图像的背景(只要您的图像具有透明度)

Ok, this is a kind of easy to fix problem with winforms.....what you have to do, like blam said is set the transparency key to something like: R:1, G:2, B:3...this makes everything inside your form drawn in that color transparent...all you need to do then is set the background color of your imagebox to that color...and it should draw the image's background transparently (as long as your image has transparency)

更多推荐

Windows窗体玻璃效果,使ImageBox透明

本文发布于:2023-11-12 03:59:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580457.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   透明   效果   玻璃   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!