当前位置:首页 > 趣味小程序 > 正文内容

【C++图形化编程】EasyX函数~图形绘制相关函数(2)

亿万年的星光5年前 (2021-02-27)趣味小程序1866

(1)ellipse  椭圆

void ellipse(
	int left,
	int top,
	int right,
	int bottom);

参数

left

椭圆外切矩形的左上角 x 坐标。

top

椭圆外切矩形的左上角 y 坐标。

right

椭圆外切矩形的右下角 x 坐标。

bottom

椭圆外切矩形的右下角 y 坐标。

image.png

(2)pie扇形

void fillpie(
	int left,
	int top,
	int right,
	int bottom,
	double stangle,
	double endangle);

left

扇形所在椭圆的外切矩形的左上角 x 坐标。

top

扇形所在椭圆的外切矩形的左上角 y 坐标。

right

扇形所在椭圆的外切矩形的右下角 x 坐标。

bottom

扇形所在椭圆的外切矩形的右下角 y 坐标。

stangle

扇形的起始角的弧度。

endangle

扇形的终止角的弧度。

(3)ctangle  矩形

void fillrectangle(
	int left,
	int top,
	int right,
	int bottom);

参数

left

矩形左部 x 坐标。

top

矩形顶部 y 坐标。

right

矩形右部 x 坐标。

bottom

矩形底部 y 坐标。

(4)roundrect  圆角矩形

void fillroundrect(
	int left,
	int top,
	int right,
	int bottom,
	int ellipsewidth,
	int ellipseheight);

参数

left

圆角矩形左部 x 坐标。

top

圆角矩形顶部 y 坐标。

right

圆角矩形右部 x 坐标。

bottom

圆角矩形底部 y 坐标。

ellipsewidth

构成圆角矩形的圆角的椭圆的宽度。

ellipseheight

构成圆角矩形的圆角的椭圆的高度。

(5)circle 圆

void circle(
	int x,
	int y,
	int radius);

参数:

x

圆心 x 坐标。

y

圆心 y 坐标。

radius

圆的半径。

(6)line  线

void line(
	int x1,
	int y1,
	int x2,
	int y2);

参数:

x1

直线的起始点的 x 坐标。

y1

直线的起始点的 y 坐标。

x2

直线的终止点的 x 坐标。

y2

直线的终止点的 y 坐标。


扫描二维码推送至手机访问。

版权声明:本文由青少年编程知识记录发布,如需转载请注明出处。

分享给朋友:

相关文章

C++自动关机小程序

/*  C++ 自动关机程序  实现原理:调用计算机内部的shutdown 命令       ...

【算法】前缀和与差分(1)一维数组前缀和

【算法】前缀和与差分(1)一维数组前缀和

一、定义前缀和:是指某序列的前n项和。可以理解成数学上上的数列的前n项和。差分:是前缀和的逆运算。二、前缀和的分类可以分成一维数组的前缀和和二维 数组的前缀和一维数组前缀和  &n...

EasyX小游戏—双人反弹球

参考代码:#include <conio.h> #include <graphics.h> #include<windows.h> #de...

C++实现走迷宫小游戏

1.简单版本简单版本是利用字符数组实现的,利用字符数组设定入口和出口,用户每次按键就刷新一下当前字符数组。参考代码:#include<stdio.h>#include<stdlib....

EasyX—制作复杂动画效果

这篇文章来简单学习一下复杂动画效果。本文资源下载地址:这里参考代码#include <graphics.h> #include <conio.h> in...

C++ 实用趣味小程序(1)

1.仿动画效果#include <cstdio>#include <windows.h>  //内含延时函数 #include <process.h> /...