I am trying to create an image of a Panel and save it to a folder. The problem is the panel has scrollbars and the image generated is only for the visible portion of the Pan
Hmmm... It sounds like (as you did not say so in the original question) but would you have a picturebox acting as a container inside the panel's container i.e. nested containers?
Have you not considered doing this:
// Assume pic is the type of PictureBox and the image property is assigned PictureBox pic; // And that the picturebox is embedded in the Panel variable p. p.Controls.Add(pic); // ... // So why not do this? pic.Image.Save(...);
The Save
method of the Image class has 5 overloads so choose one at your convenience.
Hope this helps, Best regards, Tom.