Make overlapping picturebox transparent in C#.net

后端 未结 3 893
深忆病人
深忆病人 2020-12-03 23:41

I have two overlapping pictureboxes.The images of both picture boxes have some transparent pixels.I want to see the bottom picture box through the transparent pixels of the

3条回答
  •  一整个雨季
    2020-12-03 23:51

    Clearly you are using Winforms. Yes, transparency is simulated by drawing the pixels of the Parent. Which is the form, you only see the form pixels, stacking effects don't work. There's a KB article that shows a workaround for this. It is painful. Another approach is to not use PictureBox controls but just draw the images in the form's Paint event.

    Consider WPF, it has a very different rendering model that easily supports transparency.

提交回复
热议问题