Visual Studio Form App中的C#pictureBox透明bg [英] c# pictureBox transparent bg in visual studio form app

查看:173
本文介绍了Visual Studio Form App中的C#pictureBox透明bg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我对pict​​ureBox有问题,我向其中添加了ball.png(也尝试过gif)文件,但我尝试对其进行透明的bg处理.我将BackColor更改为Transparent,但没有任何改变.

Hello all!
I have a problem with a pictureBox, i add a ball.png (also tryed gif) file to it, but i tryed to make transparent bg to it. I changed the BackColor to Transparent , but it didn''t change anything. Any idea?

推荐答案

您的PNG或GIF是否具有透明背景?
您需要按分层查看屏幕上的任何图形(图形包括窗体,控件,图像,窗口,其他应用程序,光标等). Windows首先绘制"底层,最后绘制"顶层(您看到的内容).

在这种情况下,您可以说:
1.桌面
2.您的表格
3.窗体上的控件(图片框)
4.图片框中的图片,按钮上的文字等...

这意味着即使您的图片框是透明的,但如果图片不是透明的,它也不会显示其下方的内容.

希望这会有所帮助吗?
Does your PNG or GIF have a transparent background?
You need to see any drawing on a screen (drawing includes forms, control, images, windows, other application, cursors, ...) as layered. Windows ''draws'' the bottom layer first and the top layer (what you see) as last.

In this specific case you could say:
1. Desktop
2. Your form
3. The controls on the form (Picturebox)
4. The picture in the picturebox, text on buttons, etc...

This means that even if your picturebox is transparent, if you image is not, it will not show the contents below it.

Hope this helps?


这篇关于Visual Studio Form App中的C#pictureBox透明bg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆