Technical detailsA Device Context (DC) is used to define the attributes of text and images that are output to the screen or printer. The actual context is maintained by GDI. A DC, which is a handle to the structure, is obtained before output is written and released after the elements have been written. A DC, like most GDI objects, is opaque - its data cannot be accessed directly, but it can be passed to various GDI functions that will operate on it, either to draw an object, to retrieve information about it, or to change the object in some way. GDI+With the introduction of Windows XP, GDI was deprecated in favor of its successor, the C++ based GDI+ subsystem. GDI+ is an improved 2D graphics environment, adding advanced features such as anti-aliased 2D graphics, floating point coordinates, gradient shading, more complex path management, intrinsic support for modern graphics-file formats like JPEG and PNG (which were conspicuously absent in GDI), and general support for composition of affine transformations in the 2D view pipeline. GDI+ uses ARGB values to represent color. Use of these features is apparent in Windows XP's user interface and several of its applications such as Microsoft Paint, Windows Picture and Fax Viewer, Photo Printing Wizard, My Pictures Slideshow screensaver, and their presence in the basic graphics layer greatly simplifies implementations of vector-graphics systems such as Flash or SVG. The GDI+ dynamic library can be shipped with an application and used under older versions of Windows. The Microsoft .NET class library provides a managed interface for GDI+ via the GDI+ is similar (in purpose and structure) to Apple's Quartz 2D subsystem, and the open-source libart and Cairo libraries. GDI+ vulnerabilityOn September 14, 2004, a vulnerability in GDI+ and other graphics APIs was discovered related to a defect in the standard JPEG library. It allowed arbitrary code execution on any system that displayed a malicious JPEG file using a tool that used the decoder in GDI+.[1][2] A patch was released to fix the issue on October 12, 2004. GDI and GDI+ applications in Windows VistaStarting with Windows Vista, all Windows applications including GDI and GDI+ applications run in the new compositing engine, Desktop Window Manager which is built atop the Windows Display Driver Model. The GDI render path is redirected through DWM and GDI is no longer hardware-accelerated. [3][4] However, due to the nature of desktop composition (internal management of moving bitmaps and transparency and anti-aliasing of GDI+ being handled at the DWM core), operations like window moves and resizes can be faster or more responsive because underlying content need not be re-rendered. [3] Relation between GDI and GDI printersGDI printersA GDI printer or a Winprinter (similar to a Winmodem) is a print processor that uses software to do all the print processing instead of requiring the printer hardware to do it. It works by rendering an image to a bitmap on the host computer and then sending the bitmap to the printer. This allows low-cost printers to be built by printer manufacturers, because all the page composition is done in software. Usually, such printers do not natively support a page description language such as PostScript or XPS. A Winprinter uses GDI to prepare the output, which is then passed to the printer driver (usually supplied by the manufacturer) for further processing and only afterwards to the printer itself.[5] In general, usually, the lowest-cost printers are GDI devices. Most manufacturers also produce more flexible models that add PCL compatibility, or PostScript, or both. In most cases it is only the very lowest-cost models in any given manufacturer's range that are GDI-only. See alsoNotes and references
External links
| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||