Read windows programming (6)

Source: Internet
Author: User

"The Graphics Device Interface (GDI: Graphics Device Interface) is a Windows subsystem that displays graphics on video monitors and printers. As you think, GDI is a very important part of windows. Not only does the application system you write for Windows use GDI when displaying visual information, but Windows uses GDI to display user interface objects, such as menus, scroll bars, icons, and mouse cursors ."

"From the Perspective of programmers, GDI consists of hundreds of function calls and related data types, macros, and structures ."

"Graphics in Windows 98 and Microsoft Windows NT are mainly processed by the functions output by the gdi32.dll dynamic link library. In Windows 98, gdi32.dll uses a 16-bit GDI. EXE dynamic link library to execute many functions. In Windows NT, GDI. EXE is only used for 16-bit programs ."

"Because PC compatible devices can connect to many different video devices, one of the main purposes of GDI is to support devices-independent graphics. Windows programs should be able to run on any graphics output device supported by windows without any difficulty, GDI achieves this goal by isolating the features of your program from different output devices."

"Graphic output devices fall into two categories: Bit imaging devices and vector devices. Most PC output devices are bit imaging devices, which means they represent images in an array of map points, including video display cards, dot matrix printers, and laser printers. Vector devices use a line to draw images, which is usually limited to the drawing machine ."

"Many traditional computer graphics programming methods are completely vector-based, which means that programs using vector graphics systems are isolated from hardware at a certain level. The output device uses a graphic element to express the image, but the program and program interface do not communicate with each other using a graphic element. Of course, you can use Windows GDI as a high-order vector rendering system, and also use it for relatively low-level graphic operations ."

"The relationship between Windows GDI and traditional graphic interface languages is the same as that between C and other programming languages. C is famous for its high portability between different operating systems and environments. However, C is also known for allowing programmers to call low-level systems, these calls are generally not possible in other advanced languages. Just as C is sometimes considered an "advanced assembly language", you can think of GDI as a high-level interface between the hardware of a graphic device ."

"In Windows, the graphic element coordinate system is used. Most traditional graphic languages use virtual coordinate systems with the horizontal and vertical axes ranging from 0 to 32,767. Although some graphic languages do not allow you to use the pixel coordinates, Windows GDI allows you to use one of the two coordinate systems (or even the coordinate system based on the actual amount ). Virtual Coordinate systems can be used to allow programs to be independent from hardware, or the device coordinate system can be used to fully cater to environments provided by hard devices ."

"Some programmers believe that once they begin to use the graphic design method, they give up device independence. As we can see in the previous chapter, this is not completely correct. The trick is to use a theme in a method unrelated to the device. This requires the graphic interface language to provide some methods for the program to determine the hardware characteristics of the device and adjust it as appropriate ."

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.