Форум программистов «Весельчак У»
  *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: [1]   Вниз
  Печать  
Автор Тема: Система координат принтера_WinAPI & Visual C++  (Прочитано 7346 раз)
0 Пользователей и 1 Гость смотрят эту тему.
tag
Гость
« : 30-11-2005 14:03 » 

Вопрос: действуют ли для контекста принтера функции SetViewOrg и SetWindowOrg, которые изменяют физическую и логическую систему координат? Для экрана действуют безотказно!
Записан
acc15
Гость
« Ответ #1 : 30-11-2005 22:12 » 

в мсдн, не сказано что они не работают... значит должны, простой тест и все проблеммы
SetViewportOrgEx(); GetViewportOrgEx();
Записан
tag
Гость
« Ответ #2 : 01-12-2005 10:00 » 

тест показал, что не работают. Вообще в одном источнике увидел, что SetViewOrg и SetWindowOrg являются старыми функциями и их использовать не рекомендуется. А как работают SetViewportOrgEx(); GetViewportOrgEx(); я еще не разобрался
Записан
acc15
Гость
« Ответ #3 : 02-12-2005 10:30 » 

Цитата
SetViewportOrgEx
The SetViewportOrgEx function specifies which device point maps to the window origin (0,0).

BOOL SetViewportOrgEx(
  HDC hdc,        // handle to device context
  int X,          // new x-coordinate of viewport origin
  int Y,          // new y-coordinate of viewport origin
  LPPOINT lpPoint // original viewport origin
);
Parameters
hdc
[in] Handle to the device context.
X
[in] Specifies the x-coordinate, in device units, of the new viewport origin.
Y
[in] Specifies the y-coordinate, in device units, of the new viewport origin.
lpPoint
[out] Pointer to a POINT structure that receives the previous viewport origin, in device coordinates. If lpPoint is NULL, this parameter is not used.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

Remarks
This function (along with SetViewportExtEx and SetWindowExtEx) helps define the mapping from the logical coordinate space (also known as a window) to the device coordinate space (the viewport). SetViewportOrgEx specifies which device point maps to the logical point (0,0). It has the effect of shifting the axes so that the logical point (0,0) no longer refers to the upper-left corner.

//map the logical point (0,0) to the device point (xViewOrg, yViewOrg)
SetViewportOrgEx ( hdc, xViewOrg, yViewOrg, NULL)

This is related to the SetViewportOrgEx function. Generally, you will use one function or the other, but not both. Regardless of your use of SetWindowOrgEx and SetViewportOrgEx, the device point (0,0) is always the upper-left corner.

Example Code
For an example, see Redrawing in the Update Region.

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.

Цитата
GetViewportOrgEx
The GetViewportOrgEx function retrieves the x-coordinates and y-coordinates of the viewport origin for the specified device context.

BOOL GetViewportOrgEx(
  HDC hdc,        // handle to device context
  LPPOINT lpPoint // viewport origin
);
Parameters
hdc
[in] Handle to the device context.
lpPoint
[out] Pointer to a POINT structure that receives the coordinates of the origin, in device units.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.
Записан
Страниц: [1]   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines