1

Maybe I am missing something, but is it the case that when you set a pictureboxes background to transparent, all it really does is set it to the same color as the forms background?

What I am trying to do is draw an animation for the benefit of this, a bouncing ball - which I paint on the form, then overlay that with a picture frame. End result should be a bouncing ball in a picture frame, I should mention that the picture frame does not have a straight edge, so it is not possible to arrange 4 picture boxes in a frame. The ball needs to vanish behind the frame to change color and then magically bounce back out.

I have tried:

1.Setting the picture box background to pink and then key out the same pink, this basically cuts away everything, including that which is behind the picture box 2.Setting the picture box to transparent, this just displays the picture box background as the same color as the forms background. 3.I have tried painting the image in a rectangle, this had the same effect as drawing it in a picture box.

I am not sure what I am doing wrong, I am wondering if there is any other ways I could try or if someone has made a custom control or library that supports transparency?

4

3 回答 3

0

嗯...如果您想使用 Picturebox 并获得透明图像,请尝试将 picturebox 的背景设置为您的“球”(可能您需要一个图像编辑器)。并设置图片框透明。它曾经对我有用(VS Express 2010)。

于 2013-02-21T09:10:23.263 回答
0

在做了一些更深入的研究之后,我通过使用 PaintEventArgs 和 me.paint 将图像绘制到表单来解决这个问题

使用以下方法使每个图像透明:

Dim TestImage as Bitmap
TestImage.MakeTransparent(<Transparency Color>)

不过谢谢你们俩的回复。

于 2012-12-06T09:52:51.583 回答
0

尝试使用具有背景图像集的面板。这是因为; 正如您所说:透明选项仅采用父级的背景色。

于 2012-11-26T20:56:46.833 回答