SetViewportOrgEx---GDI学习
来源:互联网 发布:创世纪 许文彪 知乎 编辑:程序博客网 时间:2024/04/28 06:41
The SetViewportOrgEx function specifies which device point maps to the window origin (0,0).
总是对这个系列的函数不太清楚,ViewPort(Device Point),WindowPort(Logic Point),这个函数将参数中指定的x,y(设备坐标),映射到Window Origin(0,0),也就是你实用GDI时其坐标原点现在在(x,y)而不是UpLeft。
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.
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).
这个函数与SetViewportExtEx and SetWindowExtEx一起使用使得逻辑坐标映射到相应的设备坐标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 SetWindowOrgEx 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
SetWindowOrgEx可以达到同样的作用,但是通常情况下只应该使用其中的一个(记住),注意:不管是使用SetWindowOrgEx还是SetViewportOrgEx,设备点(0,0)始终是在左上角的。
为了以后不在这里纠缠不清,以后都只用这个函数了,现在GDI中的(0,0)现在是(x,y)了。
- SetViewportOrgEx---GDI学习
- 特别篇-GDI映射模式SetWindowOrgEx,SetViewportOrgEx
- SetViewportOrgEx
- GDI 映像方式 之 SetViewportOrgEx 与 SetWindowOrgEx 解析
- 学习GDI+
- GDI学习
- GDI+学习笔记之GDI+环境初始化
- GDI+学习笔记8-GDI+介绍
- GDI+学习笔记之GDI+环境初始化
- GDI+学习笔记之GDI+环境初始化
- GDI+学习笔记之GDI+环境初始化
- 关于GDI+学习笔记。
- GDI+学习笔记一
- C# GDI学习手记
- GDI+学习笔记2
- GDI+学习3
- 最近在学习GDI
- GDI+ 简单入门学习
- ashx是什么文件,如何创建
- Silverlight 访问WCF的跨域
- [C学习笔记].参考书推荐
- 获得网页中image
- PostgreSQL的备份脚本
- SetViewportOrgEx---GDI学习
- ValidationExpression 正则表达式
- 提高自己JAVA水平的十大技术
- 通用的权限模块是如何设计的?
- 版本管理 RCS CVS SVN Git
- 使用 Silverlight 2 和 WCF 构建服务驱动的应用程序
- 网络礼节
- silverlight 跨域socket
- ASP.NET下不错的正则表达式应用示例