Graphics Device Interface

The Graphics Device Interface (GDI) is a component of the Windows operating system. It serves as a programming interface to logical graphics devices and encapsulates the complexity of the hardware (hardware abstraction). In GDI, these logical graphics devices are referred to as device contexts; in some programming languages, the term canvas is also used. In addition to output via physical devices (graphics card or printer), output can also take place as raster graphics in memory or as a type of step log file (WMF/EMF, used as a vector graphics format under Windows).

GDI is responsible for tasks such as drawing lines and curves (vector graphics), displaying characters and bitmaps, and managing color palettes. The components DIB-Engine (Device-Independent Bitmap) and the ICM color subsystem allow device-independent processing of bitmaps or colors. If a program needs information about device-specific properties (screen resolution, screen type), it can obtain them from the device context. However, the GDI calls are largely independent of the device context. For example, a program that outputs a graphic to a screen could output it to a printer with minimal adjustments. Vector graphics and font commands are not rasterized by GDI when output directly to a printer device context, so any physical printer will output them at its optimal resolution and, for documents created by a virtual printer (such as PDF or XPS), extraction of graphics and text is possible.

This article or subsequent section is not sufficiently supported by evidence (e.g., anecdotal evidence). Information without sufficient evidence may be removed in the near future. Please help Wikipedia by researching the information and adding good supporting evidence.

Since most of the routines for drawing work on the processor and not on the graphics card, the graphics output of GDI is relatively slow. Under Windows Vista, the graphics output of GDI is completely taken over by the CPU, which makes it even slower than in earlier Windows operating systems. Since Windows 7, with the Windows "Display Driver Model v1.1", few drawing operations are again accelerated by the graphics card. For applications that need a faster 3D graphics interface, especially for games and CAx applications, DirectX and OpenGL were created.

See also

  • GDI+

Questions and Answers

Q: What is the Graphics Device Interface (GDI)?


A: The Graphics Device Interface (GDI) is an API of Microsoft Windows used to represent graphical objects and send them to output devices, such as printers or monitors.

Q: What tasks is GDI responsible for?


A: GDI is responsible for tasks such as drawing lines and curves, rendering fonts and handling palettes.

Q: What tasks is GDI NOT responsible for?


A: GDI is NOT directly responsible for drawing windows, menus, etc. That task is reserved for another subsystem built on top of GDI.

Q: What are some other systems that have components that are similar to GDI?


A: Other systems that have components that are similar to GDI include Macintosh's QuickDraw and GNOME/GTK's GDK/Xlib.

Q: What is the most significant capability of GDI over more direct methods of accessing hardware?


A: The most significant capability of GDI over more direct methods of accessing hardware is its scaling capabilities and abstraction of target devices.

Q: What is the center of all What You See Is What You Get applications for Microsoft Windows?


A: The capability to draw on multiple devices, such as a screen and a printer, and expect proper reproduction in each case is at the center of all What You See Is What You Get applications for Microsoft Windows.

Q: What is the main disadvantage of GDI for modern games?


A: The main disadvantage of GDI for modern games is that it cannot animate properly as it has no notion of synchronizing with the framebuffer and lacks rasterization for 3D. Modern games usually use DirectX or OpenGL instead, which give programmers the capabilities to use features of modern hardware.

AlegsaOnline.com - 2020 / 2023 - License CC3