![]() |
Модераторы: Akina |
![]() ![]() ![]() |
|
Колян |
|
|||
Новичок Профиль Группа: Участник Сообщений: 1 Регистрация: 11.11.2008 Репутация: нет Всего: нет |
Здравствуйте.
Мне нужно сделать скриншот части экрана, заданной в пикселях. Например (100,100)-(200,200). Это сообщение отредактировал(а) Колян - 11.11.2008, 10:20 |
|||
|
||||
Akina |
|
|||
Советчик ![]() ![]() ![]() ![]() Профиль Группа: Модератор Сообщений: 20581 Регистрация: 8.4.2004 Где: Зеленоград Репутация: 34 Всего: 454 |
Сделай скрин экрана, затем выкуси нужный кусок.
-------------------- О(б)суждение моих действий - в соответствующей теме, пожалуйста. Или в РМ. И высшая инстанция - Администрация форума. |
|||
|
||||
BorisVorontsov |
|
|||
![]() Thinker ![]() ![]() Профиль Группа: Комодератор Сообщений: 714 Регистрация: 3.11.2005 Где: Молдавия, г. Киши нёв Репутация: 5 Всего: 10 |
Добавлю, что "делается" скрин функцией GetDC с параметром NULL, а "выкусывается" функцией BitBlt (PictureBox.PaintPicture).
-------------------- [code=cpp] const char *out = "|*0>78-,+<|"; size_t cc = char_traits<char>::length(out); for (size_t i=0;i<cc;i++){cout<<static_cast<char>((out[i]^89));}cout<<endl; [/code] |
|||
|
||||
Dexx |
|
|||
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 292 Регистрация: 13.6.2005 Репутация: 5 Всего: 7 |
![]() Это сообщение отредактировал(а) Dexx - 12.11.2008, 22:39 -------------------- |
|||
|
||||
BorisVorontsov |
|
|||
![]() Thinker ![]() ![]() Профиль Группа: Комодератор Сообщений: 714 Регистрация: 3.11.2005 Где: Молдавия, г. Киши нёв Репутация: 5 Всего: 10 |
Что не так?
-------------------- [code=cpp] const char *out = "|*0>78-,+<|"; size_t cc = char_traits<char>::length(out); for (size_t i=0;i<cc;i++){cout<<static_cast<char>((out[i]^89));}cout<<endl; [/code] |
|||
|
||||
Dexx |
|
|||
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 292 Регистрация: 13.6.2005 Репутация: 5 Всего: 7 |
Windows GDI
GetDC The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI. The GetDCEx function is an extension to GetDC, which gives an application more control over how and whether clipping occurs in the client area. HDC GetDC( HWND hWnd // handle to window ); Parameters hWnd [in] Handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen. Windows 98/Me, Windows 2000/XP: To get the DC for a specific display monitor, use the EnumDisplayMonitors and CreateDC functions. Return ValuesWindows GDI GetDC The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI. The GetDCEx function is an extension to GetDC, which gives an application more control over how and whether clipping occurs in the client area. HDC GetDC( HWND hWnd // handle to window ); Parameters hWnd [in] Handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen. Windows 98/Me, Windows 2000/XP: To get the DC for a specific display monitor, use the EnumDisplayMonitors and CreateDC functions. Return Values If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL. Remarks The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace. Note that the handle to the DC can only be used by a single thread at any one time. After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL. Remarks The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace. Note that the handle to the DC can only be used by a single thread at any one time. After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. -------------------- |
|||
|
||||
BorisVorontsov |
|
|||
![]() Thinker ![]() ![]() Профиль Группа: Комодератор Сообщений: 714 Регистрация: 3.11.2005 Где: Молдавия, г. Киши нёв Репутация: 5 Всего: 10 |
Молодец, копипастить из MSDN ты умеешь. А теперь все-таки ответь на мой вопрос.
-------------------- [code=cpp] const char *out = "|*0>78-,+<|"; size_t cc = char_traits<char>::length(out); for (size_t i=0;i<cc;i++){cout<<static_cast<char>((out[i]^89));}cout<<endl; [/code] |
|||
|
||||
Dexx |
|
|||
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 292 Регистрация: 13.6.2005 Репутация: 5 Всего: 7 |
"Добавлю, что "делается" скрин функцией GetDC с параметром NULL,..."
Функция GetDC возвращает контекст устройства. -------------------- |
|||
|
||||
BorisVorontsov |
|
|||
![]() Thinker ![]() ![]() Профиль Группа: Комодератор Сообщений: 714 Регистрация: 3.11.2005 Где: Молдавия, г. Киши нёв Репутация: 5 Всего: 10 |
И что? Как это противоречит тому, что я сказал? Сдается мне, ты плохо понимаешь, что такое "контекст устройства"... -------------------- [code=cpp] const char *out = "|*0>78-,+<|"; size_t cc = char_traits<char>::length(out); for (size_t i=0;i<cc;i++){cout<<static_cast<char>((out[i]^89));}cout<<endl; [/code] |
|||
|
||||
Dexx |
|
|||
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 292 Регистрация: 13.6.2005 Репутация: 5 Всего: 7 |
getdc это только получение контекста устройства,ну ни как не картинки!
-------------------- |
|||
|
||||
BorisVorontsov |
|
|||
![]() Thinker ![]() ![]() Профиль Группа: Комодератор Сообщений: 714 Регистрация: 3.11.2005 Где: Молдавия, г. Киши нёв Репутация: 5 Всего: 10 |
Dexx, "смишной" (с)
-------------------- [code=cpp] const char *out = "|*0>78-,+<|"; size_t cc = char_traits<char>::length(out); for (size_t i=0;i<cc;i++){cout<<static_cast<char>((out[i]^89));}cout<<endl; [/code] |
|||
|
||||
![]() ![]() ![]() |
Правила форума "VB6" | |
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Akina. |
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | VB6 | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |