private void GetScreenshot(Control targetOfScreenshot)
{
try
{
var bounds = targetOfScreenshot.Bounds;
_screenshot = new Bitmap(bounds.Width, bounds.Height);
using (var g = Graphics.FromImage(_screenshot))
{
g.CopyFromScreen(targetOfScreenshot.PointToScreen(new Point(bounds.Left, bounds.Top)), Point.Empty, bounds.Size);
}
}
catch (Exception e)
{
_screenshot = null;
ErrorReport.NotifyUserOfProblem(e, "Bloom was unable to create a screenshot.");
}
}