SetMapMode,SetWindowExt,SetViewportExt,SetViewPortOrg函数的一些理解
来源:互联网 发布:windows error code 3 编辑:程序博客网 时间:2024/05/16 05:26
四个函数的原型如下(来自MSDN)
1.virtual int SetMapMode( int nMapMode ); //设置映射的模式
2.virtual CSize SetWindowExt( int cx, int cy );//设置逻辑窗口大小
3.virtual CSize SetViewportExt( int cx, int cy );//设置物理设备范围,为设定原点作准备
4virtual CPoint SetViewportOrg( int x, int y );//设置设备原点
在Windows中,物理设备总是以屏幕左上方为左边原点,其单位为像素,而逻辑设备多以客户区左上角为坐标原点(这个可以设置),单位也不统一,可以为像素,英尺等。举个例子,GetWindowRect得到的是物理坐标,而在GetClientRect得到的是逻辑坐标。函数需要用什么坐标是根据具体情况而定的。函数1和函数4的含义很容易理解,这里不说了。主要想说的是函数2和函数3之间的关系。windows画图时,有个坐标系,一个叫Window,一个叫Viewport。Window是原始的坐标系,而Viewport是用户看到的坐标系。函数2和函数3必须成对使用,用来设定两个坐标系的对应关系。其实他们设置的参数并不重要,重要的是就是这个比例关系。
pDC->SetWindowExt(10720, 5890);//
pDC->SetViewportExt(rect.right*10,rect.bottom*10);
和
pDC->SetWindowExt(1072, 589);//
pDC->SetViewportExt(rect.right,rect.bottom);本质上是一样的。得到的效果也完全一样。
- SetMapMode,SetWindowExt,SetViewportExt,SetViewPortOrg函数的一些理解
- 理解SetMapMode,SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetMapMode,SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetMapMode,SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetMapMode,SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- SetMapMode,SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- SetMapMode、SetWindowOrg、SetViewportOrg、SetWindowExt与SetViewportExt
- SetWindowExt,SetViewportExt,SetWindowOrg和SetViewportOrg的理解
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- 理解SetWindowOrg/SetViewportOrg/SetWindowExt/SetViewportExt
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt
- The GDI Coordinate Systems, SetViewportOrg, SetWindowExt, SetViewportExt, SetMapMode
- 理解SetWindowOrg,SetViewportOrg,SetWindowExt,SetViewportExt (转)
- db2 V8的有关SQL limits
- 2010年“伊泰杯”全国象棋精英赛赛在内蒙古鄂尔多斯举行!
- rmic来生成代理的时候,总是提醒说找不到类
- OLTP和OLAP
- Discuz!NT 缓存设计简析
- SetMapMode,SetWindowExt,SetViewportExt,SetViewPortOrg函数的一些理解
- OutputCache缓存技术(转)
- gridview中鼠标都改变颜色
- 十大网页设计者必看的网站
- 使用GDI+绘图
- 上班前的那点事,
- u-boot 升级后串口无输出
- 1
- 感觉PB很土,难怪现在没什么市场。