4

I want to make a PictureBox semi transparent: show the conent of a picturebox on the back put not the base color of the form.

My Project

enter image description here

The little PictureBoxs that are on the front shows the back color of the form (control) (it have "Transparent" as background color), but I want to show color Red (the background image of the big PictureBox). How can I do it?

Hunter Turner
  • 6,804
  • 11
  • 41
  • 56
willyw0nka
  • 53
  • 4

1 Answers1

1

This may not exactly answer you question, if it is not helpful, I can delete my answer. I am not sure if I completely understood. If your background image is going to be a simple PictureBox with a single color, the following should code work.

pictureBox1 - an image of a simple star

enter image description here

pictureBox2 - my red background image

Bitmap b = new Bitmap("Star.png");
b.MakeTransparent(Color.White);
pictureBox1.Image = b;
pictureBox1.BackColor = pictureBox2.BackColor; 

Before:

enter image description here

After:

enter image description here

Kyle Williamson
  • 2,251
  • 6
  • 43
  • 75