⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphics.h

📁 这是一个C++绘图的程序,使用与C++的初学者,大家请参考并提意见
💻 H
字号:
#include <stack>
#define console_width 80
#define console_height 27

using namespace std;

class point{
	public:
		int y;
		int x;
		point(){};
		point(int Y,int X){x=X;y=Y;}
};

 class  console_dc
{
		int _width,_height;
		char point_type;
		char mem[console_height][console_width];
	public:
		console_dc(int width,int height);
		void set_point_type(const char);
		void draw_a_point(const point&);
		void clear();
		bool test_type(const point&,const char);
		void refresh();


};


typedef  char  POINT_TYPE;
typedef  console_dc  DC;

class graphics
{
	DC *pdc;
public:
	graphics(DC & dc);
	void output_string(const point &pt, const char *str);
	void rect(const point&,const point&);
	void line(const point& start_point,const point& end_point);
	void fill(const point& seed_point, POINT_TYPE border_char, POINT_TYPE filled_char);
	void set_point_type(POINT_TYPE border_char);	
	void change_dc(DC & dc);
	void clear();
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -