Click here to Skip to main content
15,921,697 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.

Thanks
Posted
Updated 16-May-17 22:52pm
Comments
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 — imgbb.com[^]
 
Share this answer
 
v3
hai
just set background as transparaent
pictureBox.BackColor = Color.Transparent;

http://stackoverflow.com/questions/5522337/c-sharp-picturebox-transparent-background-doesnt-seem-to-work[^]


C#
pictureBox7.Controls.Add(pictureBox8);
   pictureBox8.Location = new Point(0, 0);
   pictureBox8.BackColor = Color.Transparent;



http://stackoverflow.com/questions/19910172/how-to-make-picturebox-transparent-in-c-net[^]
try this
 
Share this answer
 
v2
Comments
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