标题:
GDI绘图函数机制对应用程序的影响和解决方法Effect on Application by Mechanism of GDI Rendering Functions and Solutions
作者:
陈春梅, 李青元
关键字:
图形设备接口, 绘图函数, 图元输出, 几何特征Graphics Device Interface, Drawing-Function, Primitive Output, Geometric Features
期刊名称:
《Geomatics Science and Technology》, Vol.3 No.4, 2015-10-22
摘要:
对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.