Direct2D
≈ 4 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
Direct2D is a 2D vector graphics application programming interface (API) designed by Microsoft and implemented in Windows 10, Windows 8, Windows 7 and Windows Server 2008 R2, and also Windows Vista and Windows Server 2008 (with Platform Update installed). Direct2D takes advantage of hardware acceleration via the graphics processing unit (GPU) found in compatible graphics cards within personal computer, tablet, smartphone and modern graphical device. It offers high visual quality and fast rendering performance while maintaining full interoperability with classic Win32 graphics APIs such as GDI/GDI+ and modern graphics APIs such as Direct3D.
Direct2D is a 2D vector graphics application programming interface (API) designed by Microsoft and implemented in Windows 10, Windows 8, Windows 7 and Windows Server 2008 R2, and also Windows Vista and Windows Server 2008 (with Platform Update installed). Direct2D takes advantage of hardware acceleration via the graphics processing unit (GPU) found in compatible graphics cards within personal computer, tablet, smartphone and modern graphical device. It offers high visual quality and fast rendering performance while maintaining full interoperability with classic Win32 graphics APIs such as GDI/GDI+ and modern graphics APIs such as Direct3D. ==Overview== Direct2D is a native code API based on C++ that can be called by managed code and uses a "lightweight COM" approach just like Direct3D, with minimal amount of abstraction. However, unlike WPF and similarly to GDI/GDI+, Direct2D is an "immediate mode" rendering API with simple BeginDraw/Draw/EndDraw calls; Direct2D has no concept of a "scene" and does not use retained tree structures, and the rendering state is preserved between drawing calls. Direct2D can minimize CPU usage and utilize hardware rendering on a graphics card with minimum support of Direct3D Feature Level 9 with WDDM 1.1 drivers. Applications can choose to use it exclusively with CPU, the so-called software rendering by using it in conjunction with WARP10 in situations when hardware capability is not available, such as when running within a device with minimal GPU support, under terminal service, Windows session 0, or when graphics rendering is performed in a remote server with the graphical result sent back to the client device. Direct2D performance and memory usage scale linearly with primitive counts in both software and hardware. Direct2D supports high-quality rendering with the following key features: High-quality subpixel text rendering via DirectWrite for both grayscale and ClearType technique Per-primitive antialiasing Bézier geometry draw and fill Rich geometry operations (e.g. Boolean operations, path widening, outlining, etc.) Composite layers Primitive blend modes (e.g. source-over, source-copy, min blends, etc.) Image built-in and custom effects for photo adjustment, graphical and color transform Gradient brush and mesh Command list for command buffering and printing Scalable ink stroke Sprite batch for game development Direct2D allows full interoperability with GDI, GDI+, and permits rendering to and from a Direct3D surface, as well as to and from a GDI/GDI+ device context (HDC). It can be used effectively together with Windows Imaging Component (WIC) for image encoding/decoding, and with DirectWrite for text formatting and font processing. Such interoperability allows developers to gradually replace critical code paths with Direct2D code without the need to overhaul their entire source code. In Windows 10 timeframe, an Open Source project called Win2D was developed by Microsoft to further simplify the usage of Direct2D and DirectWrite in Universal Windows Platform (UWP) application. Win2D is a highly-efficient WinRT wrapper of Direct2D and DirectWrite designed from the ground up to integrate seamlessly with XAML Canvas control while preserving the power of the underlying graphics subsystem. ==See also== DirectX Direct3D Cairo – a cross platform vector graphics library OpenVG Simple and Fast Multimedia Library Starling Framework Quartz 2D ==References== ==External links== Main Direct2D page at MSDN with links to the programming guide, new features in Windows 8.1, interoperability with Direct3D, etc. Blog of Direct2D Lead Developer Thomas Olsen Blog of Direct2D Developer Tom Mulcahy Windows 7: Introducing Direct2D and DirectWrite - PDC 2008 video Windows API Code Pack for Microsoft .NET Framework - allows developing Direct2D apps in managed code Introducing Direct2D - June 2009 issue of MSDN Magazine Drawing with Direct2D - September 2009 issue of MSDN Magazine Direct2D API for Microsoft .Net Framework 4 - Direct2D API for Microsoft .Net Framework 4 USPTO application for target independent rasterization Direct2D 1.1 Migration Guide for Windows 7 Developers Charles Petzold's column on DirectX has several articles on Direct2D ranging from introductory ones like Triangles and Tessellation or Direct2D Geometries and Their Manipulations to more advanced ones like Finger Painting with Direct2D Geometries, A 2D Portal into a 3D World, etc.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1336366332 under CC BY-SA 4.0; modifications have been made.