I wanted to automate the creation of screenshots taken with my balloon tip from a notification icon, so that could easily validate the look of the different languages my application supports. Problem is that the balloon tip is absent from the screenshot although it is shown on the screen on Windows 7.
I have tried with the solutions from Capture screenshot of active window?, e.g.
// From http://www.developerfusion.com/code/4630/capture-a-screen-shot/
var sc = new ScreenCapture();
trayIcon.ShowBalloonTip(10000, "My Title", "My message", ToolTipIcon.Info);
Thread.Sleep(2000); // Just to make sure that the balloon tip is shown
sc.CaptureScreenToFile("MyScreenshot.png", ImageFormat.Png);
and
Rectangle bounds = Screen.GetBounds(Point.Empty);
using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using(Graphics g = Graphics.FromImage(bitmap))
{
trayIcon.ShowBalloonTip(10000, "My Title", "My message", ToolTipIcon.Info);
Thread.Sleep(2000); // Just to make sure that the balloon tip is shown
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
}
bitmap.Save("MyScreenshot.png", ImageFormat.Png);
}
But both take screenshots without showing the balloon tip. So, is there a way to programmatically take a screenshot that includes balloon tips?
Bonus information: On Windows 10 the balloon tip is forced into the normal notification system and taking screenshots of this works as expected.