Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Generating Bitmap image of a panel?
I want to generate a bitmap image of a panel.
Panels size is same as that of A4 size paper.
How can i do this in desktop application using C#.
Posted

1 solution

You can use Control.DrawToBitmap[^] method. For example:
C#
// Create bitmap with appropriate size
Bitmap bmpPanel = new Bitmap(myPanel.Width, myPanel.Height);

// Draw the panel to this bitmap
myPanel.DrawToBitmap(bmpPanel, new Rectangle(0, 0, myPanel.Width, myPanel.Height));

// Now you can do whatever you want with the bmpPanel...

:)
 
Share this answer
 

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