Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All

I am working on printing software in which i need to overlap two picturebox with Transparent Background for interlocking images.Please anyone tell me how to achieve it.

Updated 16-May-17 22:52pm
BillWoodruff 7-Feb-14 4:13am    
I'd need to know exactly what you mean by "interlocking" to try and assist you. Are either of the PictureBoxes' contents partially transparent ?

Try draw all child picture to parent picture!!

void ParentPictureBox_Paint(object sender, PaintEventArgs e)
    Graphics g = e.Graphics;

    var controls = this.ParentPictureBox.Controls.OfType<PictureBox>();
    foreach (var c in controls)
        g.DrawImage(c.Image, c.Location.X, c.Location.Y, c.Width, c.Height);

This is result!
tmp —[^]
Share this answer
just set background as transparaent
pictureBox.BackColor = Color.Transparent;[^]

   pictureBox8.Location = new Point(0, 0);
   pictureBox8.BackColor = Color.Transparent;[^]
try this
Share this answer
Member 9013369 7-Feb-14 1:59am    
it is correct but not working for me because i have used
PictureBox pb=new PictureBox ();
both the images is being created in pb;
at different location;
Aravindba 7-Feb-14 4:05am    
did u add both picture in one picture box in different locations ? picture box only transparent and u can see form background.picture cant transparent.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900