I have quite literally scoured the INTERNET'S DEPTHS to try to find a solution to this problem. So here's the current scenario:
- I have a
System.Windows.Forms.PictureBox
that contains my main character namedCharacter
created and placed in my form. (His images cycle through via timers set to depict him moving.) - I have a starting paint function that creates an object (a tree) via the following code:
public void MainFormPaint(object sender, PaintEventArgs e)
{
e.Graphics.DrawImage(treeImage,50,50,200,200);
}
...with this as public/global object creation:
System.Drawing.Image treeImage = System.Drawing.Image.FromFile(treeImageLocation);
Graphics treeObject;
I simply need the tree to be ABOVE/zIndexed ABOVE the main character. I have the collisions setup, but I can't accomplish this for the LIFE of me.
Things I've tried:
- Deleting the on-form "Character" and creating a new PictureBox on runtime, then layering them by using the
Controls.Add
function (which disturbed the image's transparency, and gave it a white background) - I've researched into Panels and cannot for the life of me get the transparencies to work NOR image adding/layering creation...
I don't know of a solution for this particular dilemma. To be quite honest, I don't mind if this solution has a long, complex answer.
Thank you soooo much for everybody's help!