Graphics Device Interface

The Graphics Device Interface in the architecture of Windows NT
For example GDK makes use of GDI.

The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. It was superseded by DirectDraw API and later Direct2D API.[citation needed] Windows apps use Windows API to interact with GDI, for such tasks as drawing lines and curves, rendering fonts, and handling palettes. The Windows USER subsystem uses GDI to render such UI elements as window frames and menus. Other systems have components that are similar to GDI; for example: Mac OS has QuickDraw, and Linux and Unix have X Window System core protocol.

GDI's most significant advantages over more direct methods of accessing the hardware are perhaps its scaling capabilities and its abstract representation of target devices. Using GDI, it is possible to draw on multiple devices, such as a screen and a printer, and expect proper reproduction in each case. This capability is at the center of most "What You See Is What You Get" applications for Microsoft Windows.

Simple games that do not require fast graphics rendering may use GDI. However, GDI is relatively hard to use for advanced animation, lacks a notion for synchronizing with individual video frames in the video card, and lacks hardware rasterization for 3D. Modern games usually use DirectX, Vulkan, or OpenGL instead.

Technical details

In GDI, a device context (DC) defines the attributes of text and images for the output device, e.g., screen or printer. GDI maintains the actual context. Generating the output requires a handle to the device context (HDC). After generating the output, the handle could be released.

GDI uses Bresenham's line drawing algorithm to draw aliased lines.[1]

Version history

Early versions

GDI was present in the initial release of Windows. MS-DOS programs had manipulated the graphics hardware using software interrupts (sometimes via the Video BIOS) and by manipulating video memory directly. Code written in this way expects that it is the only user of the video memory, which was not tenable on multi-tasked environment, such as Windows. The BYTE magazine, in December 1983, discussed Microsoft's plans for a system to output graphics to both printers and monitors with the same code in the forthcoming first release of Windows.[2]

On Windows 3.1x and Windows 9x, GDI can use Bit blit features for 2D acceleration, if suitable graphics card driver is installed.[3]

Windows XP

With the introduction of Windows XP, GDI+ complemented GDI. GDI+ has been written in C++. It adds anti-aliased 2D graphics, floating point coordinates, gradient shading, more complex path management, intrinsic support for modern graphics-file formats like JPEG and PNG, and support for composition of affine transformations in the 2D view pipeline. GDI+ uses RGBA values to represent color. Use of these features is apparent in Windows XP components, such as Microsoft Paint, Windows Picture and Fax Viewer, Photo Printing Wizard, and the My Pictures Slideshow screensaver. Their presence in the basic graphics layer greatly simplifies implementations of vector-graphics systems such as Adobe Flash or SVG. Besides, .NET Framework provides a managed interface for GDI+ via the System.Drawing namespace.

While GDI+ is included with Windows XP and later, the GDI+ dynamic library can also be shipped with an application and used on older versions of Windows.[4]

Because of the additional text processing and resolution independence capabilities in GDI+, the CPU undertakes text rendering.[5] The result is an order of magnitude slower than the hardware-accelerated GDI.[6] Chris Jackson published some tests indicating that a piece of text rendering code he had written could render 99,000 glyphs per second in GDI, but the same code using GDI+ rendered 16,600 glyphs per second.

GDI+ is similar (in purpose and structure) to Apple's QuickDraw GX subsystem, and the open-source libart and Cairo libraries.

Windows Vista

In Windows Vista, all Windows applications including GDI and GDI+ applications run in the new compositing engine, Desktop Window Manager (DWM), which is hardware-accelerated. As such, the GDI itself is no longer hardware-accelerated.[7][8][9] Because of the nature of the composition operations, window moves can be faster or more responsive because underlying content does not need to be re-rendered by the application.[8]

Windows 7

Windows 7 includes GDI hardware acceleration for blitting operations in the Windows Display Driver Model v1.1. This improves GDI performance and allows DWM to use local video memory for compositing, thereby reducing system memory footprint and increasing the performance of graphics operations. Most primitive GDI operations are still not hardware-accelerated, unlike Direct2D. GDI+ continues to rely on software rendering in Windows 7.[10]

GDI printers

A GDI printer or Winprinter (analogous to a Winmodem) is a printer designed to accept output from a host computer running Windows. The host computer does all print processing: GDI renders a page as a bitmap, which the printer driver receives, processes, and sends to the associated printer.[11][12] The combination of GDI and the driver is bidirectional; they receive information from the printer such as whether it is ready to print or is out of paper.

Printers that do not rely on GDI require hardware, firmware, and memory for page rendering while a GDI printer uses the host computer for this. However, a printer with its own control language can accept input from any device with a suitable driver, while a GDI printer requires a PC running Windows. GDI printers can be made available to computers on a network if they are connected as shared printers on a computer which is on and running Windows. Some "generic" GDI drivers such as pnm2ppa have been written; they aim to make GDI printers compatible with non-Windows operating systems such as FreeBSD, but they cannot support all printers.[11]

In order to allow simpler creation of drivers for Winprinters, the Microsoft Universal Printer Driver was created. This allows printer vendors to write Generic Printer Description (GPD) "minidrivers", which describe the printer's capabilities and command set in plaintext, rather than having to do kernel mode driver development.

Microsoft has moved away from this printing model with Open XML Paper Specification.

Limitations

Each window consumes GDI objects. As the complexity of the window increases, with additional features such as buttons and images, its GDI object usage also increases. When too many objects are in use, Windows is unable to draw any more GDI objects, leading to misbehaving software and frozen and unresponsive program operation.[13] Many applications are also incorrectly coded and fail to release GDI objects after use, which further adds to the problem.[14] The total available GDI objects varies from one version of Windows to the next: Windows 9x had a limit of 1,200 total objects; Windows 2000 has a limit of 16,384 objects; and Windows XP and later have a configurable limit (via the registry) that defaults to 10,000 objects per process (but a theoretical maximum of 65,536 for the entire session).[15][16] Windows 8 and later increase the GDI object limit to 65,536 per user login session.

Earlier versions of Windows such as Windows 3.1 and Windows 98 included a Resource Meter program to allow the user to monitor how much of the total system GDI resources were in use. This resource meter consumed GDI objects itself. Later versions such as Windows 2000 and Windows XP can report GDI object usage for each program in the Task Manager, but they cannot tell the user the total GDI capacity available.

Overflowing GDI capacity can affect Windows itself, preventing new windows from opening, menus from displaying, and alert boxes from appearing. The situation can be difficult to clear and can potentially require a forced reset of the system, since it prevents core system programs from functioning. In Windows 8 and 8.1, a forced log-off occurs as a result of GDI capacity overflow, instead of a reboot.

Successor

Direct2D is the successor of GDI and GDI+. Its sibling, DirectWrite, replaces Uniscribe. They were shipped with Windows 7 and Windows Server 2008 R2, and were available for Windows Vista and Windows Server 2008 (with Platform Update installed). Later, Microsoft developed Win2D, a free and open-source GDI-like class library. Win2D's target audience are developers that use C++, C#, and Visual Basic.NET to develop Universal Windows Platform apps.[17]

See also

Notes and references

  1. ^ Steven, White; David, Coulter; Mike, Jacobs (31 May 2018). "Comparing Direct2D and GDI Hardware Acceleration". Windows Developer. Microsoft.
  2. ^ Butler, John (December 1983). "Device-Independent Graphics Output for Microsoft Windows". BYTE. p. 49. Retrieved 20 October 2013.
  3. ^ "CL-GD543X Applications and Errata Book - Revision 1.2" (PDF). Cirrus Logic. April 1994. Retrieved January 4, 2025.
  4. ^ Platform SDK Redistributable: GDI+
  5. ^ "2D Drawing APIs in Windows -". DirectX Developer Blog. MSDN Blogs. May 12, 2009. Retrieved July 19, 2012.
  6. ^ Jackson, Chris. "GDI vs. GDI+ Text Rendering Performance". Chris Jackson's Semantic Consonance. Microsoft.
  7. ^ MSDN: Comparing Direct2D and GDI Hardware Acceleration
  8. ^ a b GDI is not hardware accelerated in Windows Vista
  9. ^ Layered windows...SW is sometimes faster than HW. Avalite on MSDN Blogs.
  10. ^ Thomas Olsen (October 29, 2008). "Introducing the Microsoft Direct2D API".
  11. ^ a b "Generic GDI Printer". Open Printing. The Linux Foundation. Retrieved 21 July 2021.
  12. ^ "Windows-only printers". Linux Documentation Project. Retrieved October 29, 2019.
  13. ^ Microsoft Knowledgebase article 838283 - Desktop application menus are improperly displayed if a process exceeds its GDI object quota in Windows XP or in Windows 2000 http://support.microsoft.com/kb/838283
  14. ^ Microsoft Developer Network Blog - GDI leak in Outlook 2007 causes problems when GDI usage reaches 10,000 objects http://blogs.msdn.com/rgregg/archive/2007/09/03/outlook-2007-gdi-leak-hotfix.aspx
  15. ^ Microsoft Developer Network - GDI Object limits http://msdn.microsoft.com/en-us/library/ms724291(VS.85).aspx
  16. ^ Microsoft Knowledge base Article 894500 - .NET programs designed on newer NT operating systems may malfunction on older Win 95 / Win 98 / Win ME due to lower GDI usage limits http://support.microsoft.com/kb/894500
  17. ^ "Win2D". microsoft/Win2D repo. Microsoft. Retrieved 21 July 2021 – via GitHub.com.

Read other articles:

See also: 2021 United States gubernatorial elections This article's lead section may be too long. Please read the length guidelines and help move details into the article's body. (November 2023) 2021 Virginia gubernatorial election ← 2017 November 2, 2021[1] 2025 → Turnout54.9% 7.7[2]   Nominee Glenn Youngkin Terry McAuliffe Party Republican Democratic Popular vote 1,663,158 1,599,470 Percentage 50.6% 48.6% County and independent city results Co...

 

City in Wisconsin, United StatesSaint Francis, WisconsinCityMotto: Where Your Heart RemainsLocation of St. Francis in Milwaukee County, Wisconsin.Coordinates: 42°58′11″N 87°52′36″W / 42.96972°N 87.87667°W / 42.96972; -87.87667Country United StatesState WisconsinCountyMilwaukeeIncorporatedJuly 25, 1951; 72 years ago (1951-07-25)Government • MayorKen Tutaj [1]Area[2] • Total2.57 sq&...

 

بحر البورانمعلومات عامةسميت باسم جزيرة البران الموقع الجغرافي / الإداريالإحداثيات 36°N 3°W / 36°N 3°W / 36; -3 جزء من البحر الأبيض المتوسط[1] دول الحوض الجزائر — إسبانيا — المملكة المتحدة — المغرب هيئة المياهالنوع بحرالقياساتعمق 1٬500 م متوسط العمق 1,461 قدم (445 م)تعدي...

بوابة محمديةمعلومات عامةنوع المبنى بوابةالمنطقة الإدارية District 12 (en) [1][2] البلد  إيرانبني بطلب من محمد شاه قاجار[2] أبرز الأحداثالافتتاح الرسمي 1847 التفاصيل التقنيةجزء من Tahmasp Wall (en) [2] — بازار طهران الكبير[2] مواد البناء طابوق[2] قصارة[2] بلاط[2&#...

 

MAP1S المعرفات الأسماء المستعارة MAP1S, BPY2IP1, C19orf5, MAP8, VCY2IP-1, VCY2IP1, microtubule associated protein 1S معرفات خارجية الوراثة المندلية البشرية عبر الإنترنت 607573 MGI: MGI:2443304 HomoloGene: 10047 GeneCards: 55201 علم الوجود الجيني الوظيفة الجزيئية • ربط دي إن إي• deoxyribonuclease activity• microtubule binding• tubulin binding• actin filament binding• ‏GO:00...

 

2008 California ballot proposition Elections in California Federal government U.S. President 1852 1856 1860 1864 1868 1872 1876 1880 1884 1888 1892 1896 1900 1904 1908 1912 1916 1920 1924 1928 1932 1936 1940 1944 1948 1952 1956 1960 1964 1968 1972 1976 1980 1984 1988 1992 1996 Dem Rep 2000 Dem Rep 2004 Dem Rep 2008 Dem Rep 2012 Dem Rep 2016 Dem Rep 2020 Dem Rep 2024 Dem Rep U.S. Senate 1849 1850 1852 sp 1856 1857 sp 1860 1860 sp 1868 1872 1873 1873 sp 1878 1880 1885 1886 sp 1887 1891 1891 sp ...

Everette Howard Hunt Jr. atau E. Howard Hunt (9 Oktober 1918 – 23 Januari 2007) adalah agen legendaris Central Intelligence Agency (CIA) sepanjang 1949–1970. Spesialisasinya dalam peperangan politik adalah trik kotor, sabotase dan propaganda. The New York Times menyebutnya sosok amoral tetapi paling banyak mengetahui rencana Amerika Serikat secara keseluruhan. Ia terlibat berbagai operasi pemberontakan dan penggulingan kekuasaan yang tak sejalan dengan Amerika Serikat, seper...

 

Ottoman massacre of Bulgarian civilians 41°56′33″N 24°13′8″E / 41.94250°N 24.21889°E / 41.94250; 24.21889Postcard depicting human remains from the Batak massacre. Author and date of the postcard is unknown. The Batak massacre was a massacre of Bulgarians in the town of Batak by Ottoman irregular cavalry troops in 1876, at the beginning of the Bulgarian April Uprising of 1876. The estimate for the number of casualties ranges from 1,200 to 8,000, depending on...

 

中央军委训练管理部军事体育训练中心 主要领导 主任  大校 政治委员 曹保民 大校 机构概况 上级机构 中央军事委员会训练管理部 机构类型 中央军委训练管理部直属单位 联络方式 总部  实际地址 北京市 机构沿革 成立时间 2017年 对应机构 中央军委训练管理部军事体育训练中心,隶属中央军委训练管理部,负责军事体育训练工作。 沿革 八一体工大队 中国人民解放...

Đừng nhầm lẫn với Ga đài tưởng niệm Tôn Trung Sơn (Tàu điện ngầm Quảng Châu) tại Quảng Châu. Đài tưởng niệm Tôn Trung Sơn國父紀念館Hệ thống đường sắt đô thị Đài BắcGa tàu điện ngầm Đài BắcKe gaTên tiếng TrungPhồn thể國父紀念館Phiên âmTiếng Hán tiêu chuẩnBính âm Hán ngữGuófù JìniànguǎnChú âm phù hiệuㄍㄨㄛˊ ㄈㄨˋ ㄐㄧˋ ㄋㄧㄢˋ ㄍㄨㄢˇ Thông tin chungĐịa chỉ4...

 

Species of bat Fringed myotis Conservation status Least Concern (IUCN 3.1)[1] Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Chordata Class: Mammalia Order: Chiroptera Family: Vespertilionidae Genus: Myotis Species: M. thysanodes Binomial name Myotis thysanodesMiller, 1897 The fringed myotis (Myotis thysanodes) is a species of vesper bat that is found in British Columbia, Mexico, and the western United States.[1] Description Myotis thysanodes, ...

 

Lista com as principais redes de restaurantes em atuação no Brasil. Lista Primeira loja do Habib's em São Paulo. Bob's no Rio de Janeiro. Nome Origem Categoria Fundação Unidades Bob's Rio de Janeiro Fast food 1952 787 [1] Burger King Miami Fast food 2004* 904 [2][3] Coco Bambu Fortaleza fast casual 1989 71 [4] China in Box São Paulo Fast food 1992 143 [5] Divino Fogão São Paulo fast casual 1984 200 [6] Giraffas Brasília Fast food 1981 400 [7] Habib's São Paulo Fast food 1988 421 [8]...

Eduardo Chávez Ramírez Secretario de Recursos Hidráulicos de México 1 de diciembre de 1952-25 de abril de 1958Presidente Adolfo Ruiz CortinesPredecesor Adolfo Orive AlbaSucesor Luis Echegaray Bablot Información personalNombre completo Eduardo José Agustín Chávez RamírezNacimiento 6 de mayo de 1898Ciudad de México, MéxicoFallecimiento 28 de mayo de 1982 (84 años)Ciudad de MéxicoNacionalidad MexicanaFamiliaCónyuge Margarita BarragánInformación profesionalOcupación IngenieroPart...

 

Questa voce sull'argomento nuotatori svedesi è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Segui i suggerimenti del progetto di riferimento. Eskil Lundahl Nazionalità  Svezia Nuoto Specialità Dorso, stile libero Palmarès Competizione Ori Argenti Bronzi Europei 1 1 2 Per maggiori dettagli vedi qui   Modifica dati su Wikidata · Manuale Eskil Lundahl (Malmö, 7 settembre 1905 – Bromma, 10 novembre 1992) è stato un nuotatore svedese...

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (فبراير 2021) مولوديستمعلومات عامةالتكرر 1 سنة المكان كييف البلد أوكرانيا تاريخ التأسيس 1970 موقع الويب molodist.com تعديل - تعديل مصدري - تعديل ويكي بيانات مهرجان كييف السينمائ...

Re-use of rubble from demolished concrete structures This article may be unbalanced towards certain viewpoints. Please improve the article by adding information on neglected viewpoints, or discuss the issue on the talk page. (January 2024) Concrete from a building being sent to a portable crusher. This is the first step in recycling concrete. Crushing concrete from an airfield Concrete recycling is the use of rubble from demolished concrete structures. Recycling is cheaper and more ecological...

 

23rd race of the 1994 NASCAR Winston Cup Series 1994 Mountain Dew Southern 500 Race details Race 23 of 31 in the 1994 NASCAR Winston Cup Series The 1994 Mountain Dew Southern 500 program cover, feautring Dale Earnhardt.Date September 4, 1994Official name 45th Annual Mountain Dew Southern 500Location Darlington Raceway, Darlington, South CarolinaCourse Permanent racing facility1.366 mi (2.221 km)Distance 367 laps, 501.322 mi (806.799 km)Scheduled Distance 367 laps, 501.322 mi (806.799 km)Avera...

 

Process of Synthesis of newer monosaccharides The Kiliani–Fischer synthesis, named for German chemists Heinrich Kiliani and Emil Fischer, is a method for synthesizing monosaccharides. It proceeds via synthesis and hydrolysis of a cyanohydrin, followed by reduction of the intermediate acid to the aldehyde, thus elongating the carbon chain of an aldose by one carbon atom while preserving stereochemistry on all the previously present chiral carbons. The new chiral carbon is produced with both ...

American professional basketball player John BryantBryant with Mitteldeutscher BC in 2023No. 54 – Mitteldeutscher BCPositionCenterLeagueBasketball BundesligaPersonal informationBorn (1987-06-13) June 13, 1987 (age 37)Berkeley, California, U.S.Listed height2.11 m (6 ft 11 in)Listed weight127 kg (280 lb)Career informationHigh schoolPinole Valley (Pinole, California)CollegeSanta Clara (2005–2009)NBA draft2009: undraftedPlaying career2009–presentCareer ...

 

British classical scholar Portrait of Garrod by Rodrigo Moynihan, c. 1955 Heathcote William Garrod CBE FBA ( 21 January 1878 – 25 December 1960) was a British classical scholar and literary scholar.[1] Early life and education Garrod was born in Wells, Somerset, the fifth of six children of solicitor Charles William Garrod and his wife, Louisa (née Ashby).[1] He attended Bath College and Balliol College, Oxford. He received the 1900 Gaisford prize for Greek prose, and i...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!