Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:30:34+00:00 2026-06-12T11:30:34+00:00

Hello stackoverflow community. I do not want to draw each pictureBoxes image to Panel1

  • 0

Hello stackoverflow community.

I do not want to draw each pictureBoxes image to Panel1 but instead I want to add each pictureBox image(pictureBox1,pictureBox2,pictureBox3) to a Bitmap, then set that Bitmap to Panel1’s background Image.

Is this possible?
thanks
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:30:35+00:00Added an answer on June 12, 2026 at 11:30 am

    Here’s the method I’ve found to combine multiple images into one bitmap

    public static System.Drawing.Bitmap CombineBitmap(Image[] files)
            {
                //read all images into memory
                List<System.Drawing.Bitmap> images = new List<System.Drawing.Bitmap>();
                System.Drawing.Bitmap finalImage = null;
    
                try
                {
                    int width = 0;
                    int height = 0;
    
                    foreach (Image image in files)
                    {
                        //create a Bitmap from the file and add it to the list
                        System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(image);
    
                        //update the size of the final bitmap
                        width += bitmap.Width;
                        height = bitmap.Height > height ? bitmap.Height : height;
    
                        images.Add(bitmap);
                    }
    
                    //create a bitmap to hold the combined image
                    finalImage = new System.Drawing.Bitmap(width, height);
    
                    //get a graphics object from the image so we can draw on it
                    using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(finalImage))
                    {
                        //set background color
                        g.Clear(System.Drawing.Color.Black); // Change this to whatever you want the background color to be, you may set this to Color.Transparent as well
    
                        //go through each image and draw it on the final image
                        int offset = 0;
                        foreach (System.Drawing.Bitmap image in images)
                        {
                            g.DrawImage(image,
                              new System.Drawing.Rectangle(offset, 0, image.Width, image.Height));
                            offset += image.Width;
                        }
                    }
    
                    return finalImage;
                }
                catch (Exception ex)
                {
                    if (finalImage != null)
                        finalImage.Dispose();
    
                    throw ex;
                }
                finally
                {
                    //clean up memory
                    foreach (System.Drawing.Bitmap image in images)
                    {
                        image.Dispose();
                    }
                }
            }
    

    You’ll need to create an array of images for this to work, then you could try this

            Image[] Files = new Image[3]; // Create a new array of maximum 3 indices
            Files[0] = pictureBox1.Image;
            Files[1] = pictureBox2.Image;
            Files[2] = pictureBox3.Image;
            panel1.BackgroundImage = CombineBitmap(Files); //Add the combined bitmap to the BackgroundImage
    

    Thanks,

    Have a great day and sorry for misunderstanding 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to say hello to the stackoverflow community. I've just started using knockout
Hello StackOverflow community! I started to learn Node.js recently, and decided to implement a
Hello stackoverflow community ! I am trying to figure out how to architect my
Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a
Hello again, stackoverflow community! I'm working on writing a simple blog system in Rails,
Hello StackOverflow community, The air.swf file referenced here: http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html used to launch AIR applications
Hello StackOverflow community, Is there any way to open a folder in Windows Explorer
Hello StackOverflow community, Is there any way to package the installer for an Adobe
Hello StackOverflow community, I have run into a problem that quite frankly is baffling
Hello, stackoverflow community! I am working on a rather large database-driven web application. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.