The last of WPF-GDI/GDI +, a feast of direct3d [zz]

Source: Internet
Author: User

What is GDI/GDI +?

GDI is the main graphics library for Windows applications today. it provides 2D graphics and text functionality, as well as limited imaging functionality. there is some level of acceleration support in graphics cards for GDI, but it is almost negligible nowadays (especially when compared to the level of investment in direct3d acceleration ).

GDI + was introduced around 2001 and it brought anti-aliased 2D graphics, floating point coordinates, gradients, per-pixel Alpha value support, and support for multiple image formats to the Windows platform, but no hardware acceleration into action (all rendering is done in software ). windows form provides managed wrappers on top of the GDI + interfaces.

Future of GDI/GDI +

If Microsoft executes the following plan, the development of GDI/GDI + will not happen in the future and may gradually fade out of the mainstream.

We continue to put a lot of effort in ensuring compatibility for GDI and GDI + (and windows as a whole I might add) for every Windows release, and both technologies will continue to be supported, but no functionality improvements are planned in these technologies for future Windows releases. of course, we will continue to address security and customer issues; if any arise (the GDI and GDI + development work takes place as part of the aveon organization-we invest significant time on GDI/GDI + work ).

How does WPF implement

WPF and GDI/GDI + are different technical implementations. It is the managed encapsulation of DirectX, accurate to direct3d, and all 2D performances are also implemented through it. Because direct3d is a hardware-based native API, while WPF is a managed code, WPF has the interactive overhead of managed code for Native Resources. Similar overhead exists in this regard. Therefore, the direct use of DirectX for 3D games with high performance requirements is better than that of WPF in terms of performance.

Windows Presentation Foundation does not depend on either GDI or GDI + for its rendering (GDI, GDI +, and WPF coexist side by side ). the mainstream scenario has Windows Presentation Foundation doing all its rendering through direct3d, for all primitives (2d, text, imaging, video, and of course 3d ), through direct3d's Native Interface (the managed/native transition takes place within the Windows Presentation Foundation stack, as the bulk of WPF was written in managed code ).

Since WPF depends on direct3d, its graphics performance depends on the hardware-graphics card. If the hardware itself does not support hard implementation of some graphic effects, will it bring complexity to WPF programming? Do you still need to judge whether the hardware is applicable in the code?

Don't worry, since it is a high-level encapsulation of direct3d, developers don't have to consider hardware: hardware implementation is not supported (GPU work ), then there will be soft implementation (CPU work)

Windows Presentation Foundation takes advantage of hardware rendering as appropriate. it uses direct3d to provide accelerated rendering on DirectX 7 or above, with further optimization for graphics cards with DirectX 9 and pixel shader 2.0 hardware. for machines without these capabilities, Windows Presentation Foundation uses software rendering, a CPU-based, SSE and sse2 optimized Rasterizer. this is also used when Windows Presentation Foundation is unable to render something using the hardware pipeline, and guarantees that rendering output is available within SS all machine hardware deployments.

As a result, Windows Presentation Foundation has both hardware and software pipelines, both with difference performance characteristics. this cocould make application performance very difficult to predict, since there are two code paths. in practice, hardware is reliably faster; for a given application, it's simply a matter of setting a minimum requirement. windows Presentation Foundation supports Simple runtime hardware detection and allows you to dynamically tailor your application for the platform it's running on using resource dictionaries.

Will Windows Presentation Foundation require a certain level of video card?

Windows Presentation Foundation will take advantage of the latest graphics cards, but it can also use software emulation if a system doesn't have a supported video card.

"Soft implementation" requires more CPU resources, so hardware has a great impact on the performance of WPF. So what are the requirements for the hardware that gives full play to the value of WPF?

What graphics card shocould I use for Windows Presentation Foundation?

Any high performance DX9 pixel shader 2.0 card will give good results. The fastest PS 2.0 card with the most memory your bank account can afford is the ticket.

A few years ago, the myth of win + Intel (Windows + x86 CPU) was staged. Today, a feast of WPF + graphics card hardware vendors is about to begin (WPF + GPU ).


Http:// /Archives/4-windows-presentation-foundation-graphics-under-the-hood.html


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.