Hi!
What's a good way to take a snapshot of a specific form of my app? is there a class function or something to get a snap of only a single form or do i need to calculate the desktop coordinations of my form and get a snap of those coords?
Thanks.
Best way to get a pic of a Form
Page 1 of 12 Replies - 185 Views - Last Post: 26 October 2012 - 04:40 AM
Replies To: Best way to get a pic of a Form
#2
Re: Best way to get a pic of a Form
Posted 26 October 2012 - 04:21 AM
ok sorry, i found a solution:
Rectangle bounds = this.Bounds;
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
}
bitmap.Save("E://test.bmp", ImageFormat.Bmp);
}
#3
Re: Best way to get a pic of a Form
Posted 26 October 2012 - 04:40 AM
All control have the "capability" to be displayed / captured as a bitmap.
See the following extension method I wrote.
Snippet: Control To Bitmap
See the following extension method I wrote.
Snippet: Control To Bitmap
This post has been edited by AdamSpeight2008: 26 October 2012 - 07:07 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|