Click here to Skip to main content
15,886,056 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to capture the image of the panel in the form how to get the position of the panel on the screen g-object of graphics.
C#
g.copyscreen(position ..... ,sizeblock);

Help please.

Thanks in advance.
Posted
Updated 16-Nov-11 2:03am
v4

1 solution

Why bother?
Try:
C#
Bitmap b = new Bitmap(myPanel.Width, myPanel.Height);
myPanel.DrawToBitmap(b, new Rectangle(0, 0, myPanel.Width, myPanel.Height));
 
Share this answer
 
Comments
KarthikeyanMCP 20-Oct-12 2:59am    
This solution holds good when the panel has controls which supports the DrawToBitmap. But what if the panel has controls which doesn't have the DrawToBitMap option like RichTextBox.

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