Live Chat Icon For mobile
Live Chat Icon

How do I overlay one bitmap over another

Platform: WinForms| Category: Bitmaps and Images

You can create a Graphics object from the base bitmap, and then use this Graphics object to draw the second bitmap with a transparent color that allows the base bitmap to show through.

  Bitmap Circle = (Bitmap)Image.FromFile(@'c:\circle.bmp');
  Bitmap MergedBMP = (Bitmap)Image.FromFile(@'c:\cross.bmp');
  Graphics g = Graphics.FromImage(Circle); 
  MergedBMP.MakeTransparent(Color.White);
  g.DrawImage(MergedBMP,0,0);
  g.Dispose();

  pictureBox1.Image = Circle;

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.