Is GDI+ just a layer on top of GDI, or something new?

前端 未结 3 1550
南旧
南旧 2021-02-14 18:11

When GDI+ came out, I remember all the brouhaha about how it was the \"new, faster, better\" way to display stuff in Windows. But everytime I looked at it, it seemed to me that

3条回答
  •  再見小時候
    2021-02-14 18:29

    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.

    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.


    (source: microsoft.com)

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

    ...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.

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


    (source: microsoft.com)

    (source: microsoft.com)


    (source: microsoft.com)

提交回复
热议问题