git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14237
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
}
// An easy way to capture screenshots:
}
// An easy way to capture screenshots:
-static void wxCaptureScreenshot()
+static void wxCaptureScreenshot(bool activeWindowOnly)
{
#ifdef __DOS__
#define SCREENSHOT_FILENAME _T("sshot%03i.png")
{
#ifdef __DOS__
#define SCREENSHOT_FILENAME _T("sshot%03i.png")
screenshot.Printf(SCREENSHOT_FILENAME, screenshot_num++);
} while ( wxFileExists(screenshot) && screenshot_num < 1000 );
screenshot.Printf(SCREENSHOT_FILENAME, screenshot_num++);
} while ( wxFileExists(screenshot) && screenshot_num < 1000 );
- g_displayDC->savePNGFromDC(screenshot.mb_str(), 0, 0,
- g_displayDC->sizex(),
- g_displayDC->sizey());
+ wxRect r(0, 0, g_displayDC->sizex(), g_displayDC->sizey());
+
+ if ( activeWindowOnly && gs_activeFrame )
+ {
+ r.Intersect(gs_activeFrame->GetRect());
+ }
+
+ g_displayDC->savePNGFromDC(screenshot.mb_str(),
+ r.x, r. y, r.width, r.height);
wxMessageBox(_("Screenshot captured: ") + wxString(screenshot));
}
wxMessageBox(_("Screenshot captured: ") + wxString(screenshot));
}
+ wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);