Please see my comment to the question. Probably, I actually can understand what you want to achieve.
The solution, in its basic form, is extremely easy. The problem is: you are using such thing as
PictureBox
. By some reason, this near-useless control also became the most misused control in Forms. It was designed just to do the simplest work: showing static images. But a lot of misunderstanding created an impression that the sole purpose of this control is to block the attempts to solve the problems like yours. As soon as some try to superimpose some graphical elements, introduce some motion or interactive behavior, this control, instead of helping, starts adding most ridiculous hassles. At the same time, all such problems are solved very quickly when you do simple thing: get rid of this control.
How? Please see my past answers:
Append a picture within picturebox[
^],
How do I clear a panel from old drawing[
^],
draw a rectangle in C#[
^].
More answers on graphics rendering:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
capture the drawing on a panel[
^],
Drawing Lines between mdi child forms[
^].
Now, back to your case. Now you know how to render graphics. Your layers are created in a simple way: you first render the lower layer, and then top layer. To avoid flicker, use
optimized double buffering. Here is the key: when you create a PNG for a topping element, you have to use "transparent" pixels in the parts where the background is shown. Every non-nonsense graphics editor can do it (even Photoshop :-)). Forget control
BackColor
; this is totally irrelevant.
Now, why did I say
in its basic form. Because doing this trick in a quality way is very difficult, on the level we discuss — just impossible. Every experience expert or artist will spot the fake in no time. Only very detailed 3D modeling can achieve high-quality results, but this is extremely expensive technology. I can give you an idea why.
When you photograph some olives on white plate, or brown cutting board, the background will leave color reflexes on each olive fruit, and each olive fruit will leave color reflexes on the plate/board, where there will be also the reflexes from some surrounding objects. When you cut out (make transparent) some background pixels, you will create visible pixellation. In original image, each pixel carries colors from both background and foreground and smooths pixels, but you will destroy it. If you use fuzzy selection to smooth it, you will let some background colors on the boundary pixels. And, no matter what you do, background reflexes will be visible on each fruit. And then you move it to the pizza background, "foreign" to the background used in original image. Forget about photo-realistic image.
Let's hope that hungry pizza eaters won't care too much when they order pizza. :-)
—SA