Легенда:
новое сообщение
закрытая нитка
новое сообщение
в закрытой нитке
старое сообщение
|
- Напоминаю, что масса вопросов по функционированию форума снимается после прочтения его описания.
- Новичкам также крайне полезно ознакомиться с данным документом.
 |
[C++] Как сделать print-screen программно??? 20.09.01 14:56 Число просмотров: 1254
Автор: ggg <ggg> Статус: Elderman
|
сам не пробовал
пример из msdn:
<<<<<<<<<<<<<<<
// Create a normal DC and a memory DC for the entire screen. The
// normal DC provides a "snapshot" of the screen contents. The
// memory DC keeps a copy of this "snapshot" in the associated
// bitmap.
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
hdcCompatible = CreateCompatibleDC(hdcScreen);
// Create a compatible bitmap for hdcScreen.
hbmScreen = CreateCompatibleBitmap(hdcScreen,
GetDeviceCaps(hdcScreen, HORZRES),
GetDeviceCaps(hdcScreen, VERTRES));
if (hbmScreen == 0)
errhandler("hbmScreen", hwnd);
// Select the bitmaps into the compatible DC.
if (!SelectObject(hdcCompatible, hbmScreen))
errhandler("Compatible Bitmap Selection", hwnd);
// Hide the application window.
ShowWindow(hwnd, SW_HIDE);
//Copy color data for the entire display into a
//bitmap that is selected into a compatible DC.
if (!BitBlt(hdcCompatible,
0,0,
bmp.bmWidth, bmp.bmHeight,
hdcScreen,
0,0,
SRCCOPY))
errhandler("Screen to Compat Blt Failed", hwnd);
// Redraw the application window.
ShowWindow(hwnd, SW_SHOW);
<<<<<<<<<<<<<<<
|
|
<programming>
|
[C++] Как сделать print-screen программно??? 20.09.01 13:35
Автор: myrmidon Статус: Незарегистрированный пользователь
|
|
сабж
|
 |
[C++] Как сделать print-screen программно??? 20.09.01 14:56
Автор: ggg <ggg> Статус: Elderman
|
сам не пробовал
пример из msdn:
<<<<<<<<<<<<<<<
// Create a normal DC and a memory DC for the entire screen. The
// normal DC provides a "snapshot" of the screen contents. The
// memory DC keeps a copy of this "snapshot" in the associated
// bitmap.
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
hdcCompatible = CreateCompatibleDC(hdcScreen);
// Create a compatible bitmap for hdcScreen.
hbmScreen = CreateCompatibleBitmap(hdcScreen,
GetDeviceCaps(hdcScreen, HORZRES),
GetDeviceCaps(hdcScreen, VERTRES));
if (hbmScreen == 0)
errhandler("hbmScreen", hwnd);
// Select the bitmaps into the compatible DC.
if (!SelectObject(hdcCompatible, hbmScreen))
errhandler("Compatible Bitmap Selection", hwnd);
// Hide the application window.
ShowWindow(hwnd, SW_HIDE);
//Copy color data for the entire display into a
//bitmap that is selected into a compatible DC.
if (!BitBlt(hdcCompatible,
0,0,
bmp.bmWidth, bmp.bmHeight,
hdcScreen,
0,0,
SRCCOPY))
errhandler("Screen to Compat Blt Failed", hwnd);
// Redraw the application window.
ShowWindow(hwnd, SW_SHOW);
<<<<<<<<<<<<<<<
|
 |  |
[C++] Как сделать print-screen программно??? 20.09.01 18:49
Автор: m_fox1 Статус: Незарегистрированный пользователь
|
> сам не пробовал > > пример из msdn: >
Так работает.
Можно еще GetDC(NULL);
|
|
|