Abstract

对Windows API中的GDI绘图函数进行分析研究,发现了GDI绘图函数将世界坐标系(笛卡尔坐标系)原点(0,0)映射到设备坐标系(屏幕坐标系)的原点(0,0)到(1,1)之间的像素中心处。指出了为了保持图形的几何特征不变和避免叠印,GDI绘图函数会对端点和边界像素进行折衷处理,从而出现一些很多程序员没有发现的难以理解的奇怪现象。针对这些现象给出了解释,指出了其对应用程序的影响,并提出了解决方法。 GDI drawing-functions in Windows API were analyzed and we found that GDI drawing-function mapped the world coordinate system (Cartesian coordinate system) origin (0,0) to the pixel center between (0,0) and (1,1) of the device coordinate system (screen coordinates). It pointed out that in order to maintain the same graphic geometric features and avoiding overprinting, GDI drawing functions compromised with the endpoints and the boundary pixels, which caused some strange phenomenon many programmers have not found and it was difficult to understand. In response to these phenomena, explanations are given. In addition, the effect on some applications is pointed out and solutions are proposed.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.