Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET WinForm export
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;
                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;

Please help....
Posted 4-Jul-12 3:07am
Edited 4-Jul-12 3:10am
(no name)8.9K

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 480
1 mhegazy94 460
2 Kornfeld Eliyahu Peter 315
3 Ravi Bhavnani 240
4 Shemeemsha RA 185
0 Sergey Alexandrovich Kryukov 6,890
1 OriginalGriff 6,761
2 CPallini 5,350
3 George Jonsson 3,609
4 Gihan Liyanage 2,797

Advertise | Privacy | Mobile
Web03 | 2.8.140922.1 | Last Updated 4 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100