且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GDI +只是GDI之上的一层还是其他新东西?

更新时间:2023-11-15 13:44:58

图形硬件加速了许多GDI功能,并且某些GDI +例程可能在下面使用GDI.但是大多数GDI +是独立于GDI的.

Many GDI functions are accelerated by the graphics hardware, and some GDI+ routines may use GDI underneath. But most of GDI+ is independant of GDI.

一个重要的,很明显的例子是文本渲染.在GDI +中,文本渲染完全在软件中完成;无需视频卡即可完成抗锯齿,字形像素拟合和其他效果.

An important, and telling, example is text rendering. In GDI+ text rendering is done completely in software; the anti-aliasing, glyph pixel-fitting and other effects is done without the video card.


(来源: microsoft.com )


(source: microsoft.com)

微软的克里斯·杰克逊(Chris Jackson)有一篇有趣的博客文章,其中他介绍了

Microsoft's Chris Jackson had an interesting blog post where he profiled the speed difference between text rendering in GDI and GDI+:

...我的GDI代码路径正在渲染 每个大约99,000个字形 第二,而我的GDI +代码路径是 渲染大约16,000个字形 每秒.

...my GDI code path was rendering approximately 99,000 glyphs per second, while my GDI+ code path was rendering approximately 16,000 glyphs per second.

另一个例子是线条图. GDI +支持抗锯齿的线/多边形和圆/椭圆图形,而GDI不支持:

Another example is line drawing. GDI+ supports anti-aliased line/polygon and circle/ellipse drawing, while GDI does not:


(来源: microsoft.com )

(来源: microsoft.com )


(source: microsoft.com)

(source: microsoft.com)


(来源: microsoft.com )


(source: microsoft.com)