Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

I have large content inside scrollable panel in windows form and i want to export all the content inside that panel to image .currently i am using below code but it saves only active form data.please help to save all the content.

this.treePanel.Dock = System.Windows.Forms.DockStyle.None;
                this.treePanel.Refresh();

                Bitmap bmp = new Bitmap(treePanel.Width, treePanel.Height);
                Rectangle rect = new Rectangle(0, 0, treePanel.Width, treePanel.Height);
                this.treePanel.DrawToBitmap(bmp, rect);

                this.treePanel.Dock = System.Windows.Forms.DockStyle.Fill;
                SaveFileDialog svDailog = new SaveFileDialog();
                svDailog.Filter = "JPEG Images (*.jpg,*.jpeg)|*.jpg;*.jpeg|Gif Images (*.gif)*.gif|Bitmaps (*.bmp)*.bmp";
                svDailog.FilterIndex = 1;
                DialogResult dr = svDailog.ShowDialog();
                if (dr.Equals(DialogResult.OK))
                {
                    string _filename = svDailog.FileName;
                    bmp.Save(_filename);
                 }


Please help....

Regards,
Nanju
Posted
Updated 4-Jul-12 3:10am
v2

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