Foreword: This article reprint from oneself just bought "asp.net 3.5 from getting to master" this book, this book introduces in http://www.china-pub.com/44991, this article 95% and this book content exactly the same, the other 5% is I corrected some mistakes to add after, The original sample code can only run in the IE core browser, non-IE core browser run will appear some problems, I changed some of the code. This article experienced last night I five hours of hand hit and become (and has not finished, work back to continue to play, I can not think of my typing speed degradation so fast, depressed!!! As the saying goes: good memory is not as bad as a pen, the contents of the book to fight out, opponents, to the brain, are good!!!
10th Chapter Graphic Operation
The graphical interface is one of the most important features of the Windows operating system, and Microsoft has quickly defeated its opponents and won the user's approval. Computer graphics has always been an important part of the system, and graphic operation has been one of the core development techniques in the history of Windows programming. This chapter describes how to use GDI + drawing in a asp.net Web application.
10.1 Graphics Basics
10.1.1 GDI + Introduction
Readers may have heard of Windows GDI (Graphics Device Interface, Graphical appliance interface), a graphics package for Windows operating systems that supports the graphical interface in Windows operating systems, and it also helps developers A drawing operation is performed on a computer without regard to the details of a particular device. For example, in the case of graphics output, the developer does not have to consider whether to draw on the screen or draw on the printer when drawing, only to indicate the output device so that GDI can solve the details themselves.
With the development of technology, GDI has not been able to meet the requirements in a sense, so Microsoft put GDI further encapsulation abstraction, the formation of new GDI +, and further improve performance and functionality. GDI + is the Application Programming interface (API) that forms the subsystems of the Windows XP operating system and its subsequent versions. GDI + is responsible for displaying information on the screen and on the printer, which is the improvement of GDI, as well. NET Framework structure is an important part. Like GDI, it provides support for two-dimensional graphics images and text-typesetting processing, which enables the creation of device-independent applications through GDI +. With GDI +, you can create graphics, draw text, and manipulate graphics images as objects, designed to improve performance and ease of use.
GDI + offers a number of new features compared to GDI: alpha blending, anti-aliasing, gradient and texture fills, wide lines, basic geometric curve styles, scalable areas, floating-point coordinates, embedded brushes, high quality filtering and scaling, multiple line styles, and endpoint options.
Of course, this book is not devoted to graphic programming and is limited to space, and this chapter will cover common operations.
10.1.1 GDI + Basics
Before you learn. NET GDI + graphics operations, first review several basic concepts.
1. Coordinate system
GDI + draws lines, rectangles, and other shapes in the coordinate system, the origin of the default coordinate system is the upper-left corner, and the x-axis points to the right, and the y-axis points to the bottom. The unit of measure for the default coordinate system is pixels, as shown in the figure.