Модераторы: Akina
  

Поиск:

Закрытая темаСоздание новой темы Создание опроса
> Скриншот части экрана 
:(
    Опции темы
Колян
Дата 11.11.2008, 10:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 1
Регистрация: 11.11.2008

Репутация: нет
Всего: нет



Здравствуйте.
Мне нужно сделать скриншот части экрана, заданной в пикселях. Например (100,100)-(200,200).

Это сообщение отредактировал(а) Колян - 11.11.2008, 10:20
PM MAIL   Вверх
Akina
Дата 11.11.2008, 11:09 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Советчик
****


Профиль
Группа: Модератор
Сообщений: 20581
Регистрация: 8.4.2004
Где: Зеленоград

Репутация: 34
Всего: 454



Сделай скрин экрана, затем выкуси нужный кусок.


--------------------
 О(б)суждение моих действий - в соответствующей теме, пожалуйста. Или в РМ. И высшая инстанция - Администрация форума.

PM MAIL WWW ICQ Jabber   Вверх
BorisVorontsov
Дата 12.11.2008, 10:24 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


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]
PM MAIL ICQ GTalk   Вверх
Dexx
Дата 12.11.2008, 22:39 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 292
Регистрация: 13.6.2005

Репутация: 5
Всего: 7



Цитата(BorisVorontsov @ 12.11.2008,  10:24)
Добавлю, что "делается" скрин функцией GetDC с параметром NULL,

 smile 

Это сообщение отредактировал(а) Dexx - 12.11.2008, 22:39


--------------------

PM   Вверх
BorisVorontsov
Дата 13.11.2008, 11:47 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


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]
PM MAIL ICQ GTalk   Вверх
Dexx
Дата 14.11.2008, 19:44 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 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.


--------------------

PM   Вверх
BorisVorontsov
Дата 14.11.2008, 23:18 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


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]
PM MAIL ICQ GTalk   Вверх
Dexx
Дата 18.11.2008, 20:15 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 292
Регистрация: 13.6.2005

Репутация: 5
Всего: 7



"Добавлю, что "делается" скрин функцией GetDC с параметром NULL,..."

Функция GetDC возвращает контекст устройства.



--------------------

PM   Вверх
BorisVorontsov
Дата 19.11.2008, 11:09 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Thinker
**


Профиль
Группа: Комодератор
Сообщений: 714
Регистрация: 3.11.2005
Где: Молдавия, г. Киши нёв

Репутация: 5
Всего: 10



Цитата(Dexx @  18.11.2008,  20:15 Найти цитируемый пост)
Функция GetDC возвращает контекст устройства.


И что? Как это противоречит тому, что я сказал?
Сдается мне, ты плохо понимаешь, что такое "контекст устройства"...


--------------------
[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]
PM MAIL ICQ GTalk   Вверх
Dexx
Дата 23.11.2008, 01:31 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 292
Регистрация: 13.6.2005

Репутация: 5
Всего: 7



getdc это только получение контекста устройства,ну ни как не картинки!


--------------------

PM   Вверх
BorisVorontsov
Дата 23.11.2008, 02:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


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]
PM MAIL ICQ GTalk   Вверх
  
Закрытая темаСоздание новой темы Создание опроса
Правила форума "VB6"
Akina

Запрещается!

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

  • Литературу по VB обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • Используйте теги [code=vb][/code] для подсветки кода. Используйтe чекбокс "транслит" (возле кнопок кодов) если у Вас нет русских шрифтов.


Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Akina.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | VB6 | Следующая тема »


 




[ Время генерации скрипта: 0.0769 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.