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

  • Home
  • SEARCH
  • 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 7035321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:17:26+00:00 2026-05-28T01:17:26+00:00

I have a form that has 2 panels. I’m trying to save the contents

  • 0

I have a form that has 2 panels. I’m trying to save the contents of Panel2 as an image. I saw a thread that talked about using the screen capture to do this, but I can’t find the thread anymore. Also read about using the DrawToBitMap method, but it’s from visual studio 2005 info, not sure if it’s the most current or suitable solution for this. So what do you recommend for saving my Panel2 as a picture, preferably a jpg?

UPDATE:
I implemented the code recommended below for the DrawToBitMap, but it saves half of my panel2 (the left half if that makes a difference).
Because it saved half my panel2, I multiplied the width call by ‘2’ to make it save the full form. Kind of a weird thing and doesn’t make sense to me since the width of panel 2 should be the full panel and not half of it?

//multiplies the width of panel2 call by 2 to make it save the full panel
Bitmap bmp = new Bitmap(splitContainer1.Panel2.Width * 2, splitContainer1.Panel2.Height);
splitContainer1.Panel2.DrawToBitmap(bmp, splitContainer1.Panel2.Bounds);
bmp.Save(@"C:\Test.bmp");
  • 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-05-28T01:17:27+00:00Added an answer on May 28, 2026 at 1:17 am

    Control.DrawToBitMap is still supported in .Net 4. With the following caveats.

    From above link:

    • The DrawToBitmap method is not supported for ActiveX controls. You
      can override the OnPrint event and provide custom printing logic if
      required.

    The DrawToBitmap method has the following limitations:

    • An ArgumentException might be thrown for large bitmaps. The maximum
      allowable size varies by machine.
    • DrawToBitmap does not support the Ink controls for the Windows XP
      Tablet PC Edition 2005 operating system.
    • DrawToBitmap does not draw a child TextBox if the Visible property of
      the TextBox is set to false.
    • Controls inside containers are rendered in reverse order.
    • DrawToBitmap is not fully functional for the RichTextBox; only the
      border of a bitmap is drawn.

    Edit Added example and image:

    Bitmap bmp = new Bitmap(panel1.Width,panel1.Height);
    panel1.DrawToBitmap(bmp, panel1.Bounds);
    bmp.Save(@"C:\Temp\Test.bmp");
    

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

Sidebar

Related Questions

I have a custom form that has 4 panels on it edges. I would
I have two update panels on my page. The first has a form that
I have a form that has label values that I would like to pass
I have a form that has a group of 3 text_fields. I need two
I have a form that has many long-methods. My quest is: What is the
I have a form that has 8 columns and a variable number of rows
I have a form that has a series of check boxes and some line
i have a form that has a multiple select drop down. a user can
I have a form that has two buttons on it, one yes, one no,
I have a form that has 90 buttons on it, one button for each

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.