Void marker coord(int x, int y) Void Marker( Point *pt) 端点做标记。 Void Polygon(int Vertex Count, Vertexlist vertices) /多边形。 Void RectanglePoint(Point leftBottom Point* rightTop) /{矩形 20212/24 Graphics Lab PKU
2021/2/24 Graphics Lab.PKU 6 Void MarkerCoord(int x, int y); Void Marker(Point *pt); //端点做标记。 Void Polygon(int VertexCount, VertexList vertices); //画多边形。 Void RectanglePoint(Point* leftBottom, Point* rightTop); //画矩形
Void Circle Arc(Point *center, int radius int startAngle, int endAngle) /圆弧 Void EllipseArc(rectangle *extern Rect, int startAngle, int endAngle) /椭圆 Typedef struct( Point leftBottom, right Top; Rectangle 起始角45度 终止交270度 20212/24 Graphics Lab PKU
2021/2/24 Graphics Lab.PKU 7 Void CircleArc(Point *center, int radius, int startAngle,int endAngle) //画圆弧 Void EllipseArc(Rectangle *externRect, int startAngle,int endAngle) //画椭圆 (x3,y3) (x4,y4) Typedef struct{ Point leftBottom,rightTop;} Rectangle
图元属性 ·线型和线宽 Void Setline style(enum Line Style lineStyle) Void Setline width(int line Width) 枚举变量 line Styple 预定义之线型 CONTINUOUS、 DASHED、 DOTTED 图元在显示时被扫描转换成离散的像素写入帧缓冲 器中,线型控制可看作有选择地写像素的位屏蔽器 ( bit marker)-位屏蔽器为“0′表示帧缓存中相应的像素值不变 (即透明),为‘1’表示用线段的颜色值代替帧缓存中相应的像素值 20212/24 Graphics Lab PKU
2021/2/24 Graphics Lab.PKU 8 图元属性 • 线型和线宽 • Void SetLineStyle(enum LineStyle lineStyle); • Void SetLineWidth(int lineWidth); • 枚举变量 lineStyple • 预定义之线型CONTINUOUS、DASHED、DOTTED • 图元在显示时被扫描转换成离散的像素写入帧缓冲 器中,线型控制可看作有选择地写像素的位屏蔽器 (bit marker). --位屏蔽器为‘0’表示帧缓存中相应的像素值不变 (即透明),为‘1’表示用线段的颜色值代替帧缓存中相应的像素值
图元属性 SRGP中,设置颜色属性有三种方式 三种指定颜色的方式 通过查色表索引值 通过颜色名称 通过红、绿、兰三分量 Void Setcolor By Name(cnum Colors colorName) ∥使用逻辑颜色名,实际对应的颜色取决于系统查色表 Void Setcolor(int colorIndex) ∥直接使用整数值来指定, colorIndex即是指向査色表某表项的 索引值 Void Setcolor (int red, int green, int blue) ∥直接赋颜色分量值(对真彩色系统而言) 20212/24 Graphics Lab PKU
2021/2/24 Graphics Lab.PKU 9 图元属性 • SRGP中,设置颜色属性有三种方式: • 三种指定颜色的方式 – 通过查色表索引值 – 通过颜色名称 – 通过红、绿、兰三分量 Void SetColorByName(cnum Colors colorName); //使用逻辑颜色名,实际对应的颜色取决于系统查色表 Void SetColor(int colorIndex); //直接使用整数值来指定,colorIndex即是指向查色表某表项的 索引值 Void SetColor(int red, int green, int blue); //直接赋颜色分量值(对真彩色系统而言)
填充图元及其属性 封闭的图元有二种绘制方式 -线画图:只画出边框; 填充图:填充其内部区域; Void Fillrectangle( Rectangle*rec)/矩形 Void FillPolygon(int vertex Count, VertexList Vertices) ∥多边形 Void Fillellipse( Rectangle* extentRect),∥椭圆 Void FillEllipse Arc(rectangle* extent Rect, int startAngle, int endAngle ∥)形 20212/24 Graphics Lab PKU
2021/2/24 Graphics Lab.PKU 10 填充图元及其属性 封闭的图元有二种绘制方式 -- 线画图:只画出边框; -- 填充图:填充其内部区域; Void FillRectangle(Rectangle *rec);//矩形 Void FillPolygon(int vertexCount, VertexList Vertices); //多边形 Void FillEllipse(Rectangle * extentRect); // 椭圆 Void FillEllipseArc (Rectangle * extentRect,int startAngle,int endAngle); //扇形