Programming Windows (四)_ SetViewportOrgEx() 与 SetWindowportOrgEx()
来源:互联网 发布:大学生网络贷款的认识 编辑:程序博客网 时间:2024/05/23 00:11
SetWindowOrgEx
这个Window是看不见的,可以假想有这么一个Window,提供GDI画图函数以逻辑坐标来画图,这个坐标系也叫page space坐标系,有自定义原点与单位长度(逻辑单位,如0.1mm,从而可以与设备无关)
SetViewportOrgEx
物理设备坐标总是以左为原点,以像素为单位,x向右,y向下
viewport与之区别是原点可以由SetViewportOrgEx改变,以及大小可以由SetViewportExtEx改变,这个坐标系也叫device space坐标系,viewport也是看不到的,真的能看到的只有物理坐标系
SetWindowExtEx
设定page space的大小
SetViewportExtEx
设定device space的大小
四个函数完成其功能时均参考自己所在的坐标系,并且改变自己所在的坐标系
page space坐标系映射到device space坐标系
原点重合,大小关系为两个坐标系的大小关系:
(xViewport - xViewportOrg) / (xWindow - xWindowOrg) = xViewportExt / xWindowExt
一般用SetMapMode改变映射的大小关系以及page space 的坐标方向
device space坐标系映射到物理设备坐标系,都以像素为单位,所以只需考虑位移
for example:
SetMapMode (hdc, MM_ISOTROPIC) ;
SetWindowExtEx (hdc, 276, 72, NULL) ;
SetViewportExtEx (hdc, cxClient, cyClient, NULL) ;
SetWindowOrgEx (hdc, 138, 36, NULL) ;
SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;
SetWindowExtEx
设定page space的大小
SetViewportExtEx
设定device space的大小
四个函数完成其功能时均参考自己所在的坐标系,并且改变自己所在的坐标系
page space坐标系映射到device space坐标系
原点重合,大小关系为两个坐标系的大小关系:
(xViewport - xViewportOrg) / (xWindow - xWindowOrg) = xViewportExt / xWindowExt
一般用SetMapMode改变映射的大小关系以及page space 的坐标方向
device space坐标系映射到物理设备坐标系,都以像素为单位,所以只需考虑位移
for example:
SetMapMode (hdc, MM_ISOTROPIC) ;
SetWindowExtEx (hdc, 276, 72, NULL) ;
SetViewportExtEx (hdc, cxClient, cyClient, NULL) ;
SetWindowOrgEx (hdc, 138, 36, NULL) ;
SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;
If you change the viewport orgin to (xViewOrg, yViewOrg), the logical point(0, 0)will be mapped to the device point(xViewOrg, yViewOrg)
If you change the window origin to (xWinOrg, yWinOrg), the logical point(xWinOrg, yWinOrg) will be mapped to the device point(0,0)
Regardless of any changes you make to the window and viewport origins, the device point(0, 0) is always the upper left corner of the client area
- Programming Windows (四)_ SetViewportOrgEx() 与 SetWindowportOrgEx()
- SetViewportOrgEx-Windows API
- Programming Windows (二)_ UNICODE
- Programming Windows (三)_ 消息循环
- SetViewPortOrgEx与SetWindowOrgEx
- SetWindowOrgEx 与 SetViewportOrgEx
- Programming Windows (一)_ Windows 的运行机制
- SetViewportOrgEx
- 转 关于SetViewPortOrgEx与SetWindowOrgEx
- Windows 程序设计 SetWindowExtEx SetViewportExtEx SetWindowOrgEx SetViewportOrgEx
- 关于SetWindowOrgEx与SetViewportOrgEx的用法
- SetViewportOrgEx 与 Se…
- programming windows-----窗口与消息
- GDI 映像方式 之 SetViewportOrgEx 与 SetWindowOrgEx 解析
- 也浅谈Win API函数SetWindowOrgEx与SetViewportOrgEx
- Windows Programming 第三章 窗口与消息
- Programming Windows(六)_Timer
- Programming Windows(七)_Mouse
- J2ME循环与String优化设计
- 找工作难啊
- java调用Oracle用户登录存储过程
- 在QT中如何实现一个不规则形状的窗口
- Daily Build--每日构建
- Programming Windows (四)_ SetViewportOrgEx() 与 SetWindowportOrgEx()
- Spring优势和简介
- 存储过程判断用户登录信息
- this,super的用法
- vi命令学习
- 学习
- 简单工厂模式与工厂方法模式
- [转]如何成为交际大师
- 天涯又出新语录:最新100句..我要笑疯了了