1 / 18

基本图形函数

基本图形函数. 基本图形函数 1 、画点函数 ① putpixel(int x,int y,int color); ②getpixel(int x,int y);. 有关画图坐标位置的函数 ① moveto(int x,int y); ②moverel(int dx,int dy); ③getx(void); ④gety(void);. 画线函数 ① line(int x0,int y0,int x1,int y1); ②lineto(int x,int y); ③linerel(int dx,int dy);. 画矩形和条形图函数

avak
Download Presentation

基本图形函数

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 基本图形函数

  2. 基本图形函数 • 1、画点函数 • ①putpixel(int x,int y,int color); • ②getpixel(int x,int y);

  3. 有关画图坐标位置的函数 • ①moveto(int x,int y); • ②moverel(int dx,int dy); • ③getx(void); • ④gety(void);

  4. 画线函数 • ①line(int x0,int y0,int x1,int y1); • ②lineto(int x,int y); • ③linerel(int dx,int dy);

  5. 画矩形和条形图函数 • ①rectangle(int x1,int y1,int x2,int y2); • ②bar(int x1,int y1,int x2,int y2);

  6. 画椭圆、圆和扇形函数 • ①ellipse(int x,int y,int stangle,int endangle,int xradius,int yradius); • ②circle(int x,int y,int radius); • ③arc(int x,int y,int stangle,int endangle,int radius); • ④pieslice(int x,int y,int stangle,int endangle,int radius);

  7. 二、颜色设置函数 • ①setcolor(int color); • ②setbkcolor(int color);

  8. 表1___颜色表

  9. 设定线型函数 • setlinestyle(int linestyle,unsigned upattern,int thickness);

  10. 表2___线宽 • 符号名值含义 • NORM_WIDTH 1 一个象素宽THICK_WIDTH 3 三个象素宽

  11. 表3___线的形状

  12. 四、封闭图形的填色函数 • 1、void far setfillstyle(int pattern ,int color);

  13. 填充模式(pattern)的规定

  14. 2、与填充函数有关的作图函数 • ①画三维立体直方图函数 • bar3d(int x1,int y1,int x2,int y2,int depth,int topflag); • ②画椭圆扇形函数 • sector(int x,int y,int stangle,int endangle,int xradius,int yradius); • ③画椭圆图函数 • fillellipse(int x,int y,int xradius,int yradius); • ④画多边形函数 • fillpoly(int numpoints,int far *palypoints); • ⑤对任意封闭图形填充的函数 • floodfill(int x,int y,int border);

  15. 屏幕操作函数 • 屏幕图像存储和显示函数 • ①存屏幕图像到内存区 • getimage(int x1,int y1,int x2,int y2,void far *bitmap); • ②测定图像所占字节数的函数 • imagesize(int x1,int y1,int x2,int y2); • ③将所存图像进行处理后显示函数 • putimage(int x1,int y1,void far *bitmap,int op);

  16. 表4___op规定值及操作

  17. 图形方式下的文本输出函数 • 当前位置文本输出函数 • outtext(char far *textstring); • 定位文本输出函数 • outtextxy(int x,int y,char far *stextstring); • 文本输出位置函数 • settextjustify(int horiz,int vert);

More Related