1、C# Graphics Basics
Visual C# provides all of the tools you need to create any type of graphics and charts. It supplies a GDI+ class library interface that allows users to draw various graphics objects, including text, lines, rectangles, circles, ellipses, polygons, and a host of other graphical shapes. This chapter begins by describing graphics coordinate systems used in Visual C#, and shows you several different coordinate systems you can use to make graphics programming easier. Then it will discuss two basic drawing objects, Pen and Brush, that are used to draw basic graphics shapes and fill enclosed surface with patterns, colors, or bitmaps. It will show you how to use Pen and
Brush to create basic graphics shapes. Finally, it will explain the color system used in C# and discuss how to define the custom color map and shading.
Visual C #提供了所有的您需要创建任何类型的图形和图表工具。它提供了一个GDI +的类库接口,允许用户绘制各种图形对象,包括文字, 线,矩形,圈,椭圆,多边形,以及一系列其他的图形形状。本章首先描述用在Visual C #的图形坐标系统 ,并为你显示出几个不同坐标系统,你可以使用它使图形编程更加容易。然后,将讨论两个基本绘图对象,笔和刷子,用来提请基本图形的形状和填补封闭表面形态,颜色,或点阵图。它会向你展示如何使用笔和
刷创建基本图形的形状。最后,它将解释C #中的色彩系统的使用和如何确定自定义颜色和阴影地图。
Coordinate Systems坐标系
When creating a graphic object, you must determine where the graphic object or drawing will be displayed. To do that, you need to understand how Visual C# measures graphic object coordinates.
Each point on a Window Form or a control has an X and a Y coordinate. In the following sections,
we will discuss various coordinate systems and their relationships.
当创建一个图形对象,您必须确定图形对象或图样将在哪里显示。为了做到这一点,你需要了解Visual C #度量图形对象的坐标。 在Windows窗体的每个点或控件有一个X和Y坐标。以下各节中, 我们将讨论不同的坐标系及其相互关系。
Default Coordinates 默认坐标
Visual C# and GDI+ graphics library have three default coordinate systems in 2D space: world,
page, and device. World coordinates are the coordinates used to model a particular graphic world
and are the coordinates you pass to methods in C#.
在Visual C #和GDI +的图形库中,二维空间中有三个预设坐标系:世界, 网页,和设备。世界坐标系的坐标模型用于某一特定的图形世界并通过你的坐标的方法在C # 。