2012-06-10 30 views

回答

1
Picturebox1.visible = true \\ will turn on a box 
Picture box.visible = false \\ will turn a box off 

发生在一个两框的另一个然后打开你不想被看到的一个,并且关闭了一个你不希望看到的,颠倒顺序在它们之间切换。

0
Me.Picturebox2.Parent = Me.Picturebox1 : Me.Picturebox2.Visible = True 
+1

小心添加一些评论你的代码?什么期望,为什么你建议呢? – Yaroslav

0

我想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 
+0

有一两个飞蛾老,但我发现自己在寻找它之前长时间寻找那种答案,希望对其他人有用。 –

0

附加面板1和集图像面板1 添加面板2,并设置图像面板2

拖动面板1或2到面板1或2,你想让它后面或前面

所以透明