我有两个Picturebox,两者都应该是透明的背景,但真正的问题是透明的形式背景,但没有彼此超过。使图片框在其他图片框上透明吗?
这里是我的问题的照片: http://www.saj-sa.com/problem.gif
我有两个Picturebox,两者都应该是透明的背景,但真正的问题是透明的形式背景,但没有彼此超过。使图片框在其他图片框上透明吗?
这里是我的问题的照片: http://www.saj-sa.com/problem.gif
Picturebox1.visible = true \\ will turn on a box
Picture box.visible = false \\ will turn a box off
发生在一个两框的另一个然后打开你不想被看到的一个,并且关闭了一个你不希望看到的,颠倒顺序在它们之间切换。
Me.Picturebox2.Parent = Me.Picturebox1 : Me.Picturebox2.Visible = True
小心添加一些评论你的代码?什么期望,为什么你建议呢? – Yaroslav
我想op想让这两个图像都可见,但第一个女孩的透明部分是真正透明的,而不是隐藏另一个女孩。
实现,你需要所有的图像添加到相同的图形元素,从最深的一个(背景)开始到最高之一(一个在顶部)
private back as New bitmap("C:/background.bmp")
private girlOnTop as New bitmap("C:/topGirl.bmp")
private girlInMiddle as New bitmap("C:/middleGirl.bmp")
'set the size of your graphic base on the background
Dim BMP As New Bitmap(back.Width, back.Height)
'create a graphic base on that
Dim GR As Graphics = Graphics.FromImage(BMP)
'draw onto your bmp starting from the background
GR.DrawImage(back, 0, 0)
'set X,y to the coordinate you want your girl to appear
GR.DrawImage(middleGirl, X, Y)
GR.DrawImage(topGirl, X, Y)
'clear the picturebox
pbox1.Image = Nothing
'now that we have draw all our image onto the same bitmap, assign it to your picturebox element
pbox1.Image = BMP
有一两个飞蛾老,但我发现自己在寻找它之前长时间寻找那种答案,希望对其他人有用。 –
附加面板1和集图像面板1 添加面板2,并设置图像面板2
拖动面板1或2到面板1或2,你想让它后面或前面
所以透明
[Winforms semi-transparent PNG over semi-transparent PNG]可能重复(http://stackoverflow.com/questions/10455484/winforms-semi-transparent-png-over-semi-transparent-png) –