Comparative advantages of WPF GDI, GDI+

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

In the development of.NET related field, the user interface is implemented by Windows Forms or Web Forms. Although Windows Forms has appeared in many years, also provides fast, efficient function. However, the Windows Forms development of the UI interface is relatively monotonous, and through the.NET Framework package after the development of Library in the custom and the bottom function on the lack of real support. WPF and Win32, WinFormsGDI is the Window desktop application mainstream graphics library, GDI graphics system has been formed for many years. It provides 2D graphics and text function, and the constrained image processing function. Although the acceleration of some graphics cards support part of GDI, but with today's mainstream Direct3D acceleration is very weak. GDI+ began to appear in 2001, it introduces anti aliased graphics 2D, floating point coordinates, gradual change and single pixel Alpha support, a variety of image formats are supported. However, GDI+ did not accelerate any function (all with software).

Familiar with Windows XP and Windows Forms friends may know, synthesis of a senior also supports Windows Forms, support the translucent form, but, in the Windows Forms technology is the realization of translucent camouflage. For example, explicit translucent window, the parent window's background is realized through the window.

In WPF, the introduction of a new graphics synthesis engine. Can offer more rich graphics explicit synthesis, and will not have any window flicker problem. This new explicit submission engine and traditional Win32, Windows compared to Forms has two main advantages:

1,Each window all elements can be arbitrary overlapping.

2,Synthesis of all is off screen surface in Direct3D (Off-screen Surface) in the realization of.

In this new way, the background is no longer necessary. For example, we hope that in the window of an explicit literal strings, usually, in the Win32 or Windows Forms explicit effect as a static text labels: it is the default system controls the background color. In WPF, a text string directly to the target location, and whether the target area background color.

In Windows Vista, GDI and GDI+ are still supported, but did not improve any functional basically. Improvement of GDI and GDI+ mainly focus on issues related to security and customer. In Windows Vista, GDI, GDI+ and WPF exist in parallel, all submitted to WPF are not dependent on GDI and GDI+, but Direct3D. And all Primitive are achieved by using the local Direct3D interface. Milcore components in the WPF system, in the form of packaging to unmanaged code with all the functions of the Direct3D interaction. Because most code WPF exists as managed code in the form of WPF, so there are a lot of trusteeship, interactive unmanaged. Of course, in some graphics card does not support the required WPF function, WPF also provides a slightly inefficient software to support WPF applications run in some PC.

In the implementation of WPF, each drawing object corresponds to a screen surface. Explicit window is not directly on the screen explicit region, but the use of the explicit card to provide additional off screen surface memory. When the drawing operation after completion of the screen surface, synthetic submission engine then each require explicit off screen surface for the synthesis of an individual can be explicit surface. The explicit approach is no longer needs us to use the double buffer drawing traditional to avoid flash window, this function has a default implementation of WPF.

At the same time, from the use of screen surface can also type card GPU significantly more convenient use (graphics processing unit, Graphics Processing Unit) to implement the cable laying, rotation, transform etc.. This also means that the common 3D function can also be easily implemented in WPF.

On the screen surface note: don't make the mistake of understanding for the WPF will need to use modern graphics display card (the rich functionality of 3D explicit card). Indeed, in the future to realize 3D user interface really is possible. However, WPF has made great effort to make full use of the GPU, the 3D element abstraction, encapsulation, make people to realize the function of 3D with 2D like programming.

The current version of WPF, still do not have very good support for some Win32 features, such as the WMF/EMF file, a single pixel width line etc.. For these requirements also need to use GDI/GDI+ to realize.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Adair at November 14, 2013 - 3:35 PM