c++ easyX库官方原版下载安装包
资源内容介绍
适用于c++初学者进阶使用easyX库时需要用easyX.h库,graphics.h库时不至于编译失败,适用于Dev-c++、Vs或小熊猫Dev-c++。教程在CSDN上、博客园和github上到处都有配置教程,可以自己找,我就不再此叙述啦,可参考https://*************/Dustinthewine/article/details/129431962这位大神写的教程或https://*************/weixin_61777209/article/details/124185685这篇大神写的。easyX库使用教程请参考https://*************/qq_52661581/article/details/125124212命令请参考https://*************/weixin_44690490/article/details/100679271(仅转载与推荐,无恶意,望大神见谅。) /****************************************************** * EasyX Library for C++ (Ver:20240601) * https://easyx.cn * * EasyX.h * Provides the latest API. ******************************************************/#pragma once#ifndef WINVER#define WINVER 0x0400 // Specifies that the minimum required platform is Windows 95 and Windows NT 4.0.#endif#ifndef _WIN32_WINNT#define _WIN32_WINNT 0x0500 // Specifies that the minimum required platform is Windows 2000#endif#ifndef _WIN32_WINDOWS#define _WIN32_WINDOWS 0x0410 // Specifies that the minimum required platform is Windows 98#endif#ifdef UNICODE #pragma comment(lib,"EasyXw.lib")#else #pragma comment(lib,"EasyXa.lib")#endif#ifndef __cplusplus#error EasyX is only for C++#endif#include <windows>#include <tchar>// EasyX Window Properties#define EX_SHOWCONSOLE 1 // Maintain the console window when creating a graphics window#define EX_NOCLOSE 2 // Disable the close button#define EX_NOMINIMIZE 4 // Disable the minimize button#define EX_DBLCLKS 8 // Support double-click events// Color constant#define BLACK 0#define BLUE 0xAA0000#define GREEN 0x00AA00#define CYAN 0xAAAA00#define RED 0x0000AA#define MAGENTA 0xAA00AA#define BROWN 0x0055AA#define LIGHTGRAY 0xAAAAAA#define DARKGRAY 0x555555#define LIGHTBLUE 0xFF5555#define LIGHTGREEN 0x55FF55#define LIGHTCYAN 0xFFFF55#define LIGHTRED 0x5555FF#define LIGHTMAGENTA 0xFF55FF#define YELLOW 0x55FFFF#define WHITE 0xFFFFFF// Color conversion macro#define BGR(color) ( (((color) & 0xFF) << 16>> 16) )class IMAGE;// Line style classclass LINESTYLE{public: LINESTYLE(); LINESTYLE(const LINESTYLE &style); LINESTYLE& operator = (const LINESTYLE &style); virtual ~LINESTYLE(); DWORD style; DWORD thickness; DWORD *puserstyle; DWORD userstylecount;};// Fill style classclass FILLSTYLE{public: FILLSTYLE(); FILLSTYLE(const FILLSTYLE &style); FILLSTYLE& operator = (const FILLSTYLE &style); virtual ~FILLSTYLE(); int style; // Fill style long hatch; // Hatch pattern IMAGE* ppattern; // Fill image};// Image classclass IMAGE{public: int getwidth() const; // Get the width of the image int getheight() const; // Get the height of the imageprivate: int width, height; // Width and height of the image HBITMAP m_hBmp; HDC m_hMemDC; float m_data[6]; COLORREF m_LineColor; // Current line color COLORREF m_FillColor; // Current fill color COLORREF m_TextColor; // Current text color COLORREF m_BkColor; // Current background color DWORD* m_pBuffer; // Memory buffer of the image LINESTYLE m_LineStyle; // Current line style FILLSTYLE m_FillStyle; // Current fill style virtual void SetDefault(); // Set the graphics environment as defaultpublic: IMAGE(int _width = 0, int _height = 0); IMAGE(const IMAGE &img); IMAGE& operator = (const IMAGE &img); virtual ~IMAGE(); virtual void Resize(int _width, int _height); // Resize image};// Graphics window related functionsHWND initgraph(int width, int height, int flag = 0); // Create graphics windowvoid closegraph(); // Close graphics window// Graphics environment related functionsvoid cleardevice(); // Clear devicevoid setcliprgn(HRGN hrgn); // Set clip regionvoid clearcliprgn(); // Clear clip regionvoid getlinestyle(LINESTYLE* pstyle); // Get line stylevoid setlinestyle(const LINESTYLE* pstyle); // Set line stylevoid setlinestyle(int style, int thickness = 1, const DWORD *puserstyle = NULL, DWORD userstylecount = 0); // Set line stylevoid getfillstyle(FILLSTYLE* pstyle); // Get fill stylevoid setfillstyle(const FILLSTYLE* pstyle); // Set fill stylevoid setfillstyle(int style, long hatch = NULL, IMAGE* ppattern = NULL); // Set fill stylevoid setfillstyle(BYTE* ppattern8x8); // Set fill stylevoid setorigin(int x, int y); // Set coordinate originvoid getaspectratio(float *pxasp, float *pyasp); // Get aspect ratiovoid setaspectratio(float xasp, float yasp); // Set aspect ratioint getrop2(); // Get binary raster operation modevoid setrop2(int mode); // Set binary raster operation modeint getpolyfillmode(); // Get polygon fill modevoid setpolyfillmode(int mode); // Set polygon fill modevoid graphdefaults(); // Reset the graphics environment as defaultCOLORREF getlinecolor(); // Get line colorvoid setlinecolor(COLORREF color); // Set line colorCOLORREF gettextcolor(); // Get text colorvoid settextcolor(COLORREF color); // Set text colorCOLORREF getfillcolor(); // Get fill colorvoid setfillcolor(COLORREF color); // Set fill colorCOLORREF getbkcolor(); // Get background colorvoid setbkcolor(COLORREF color); // Set background colorint getbkmode(); // Get background modevoid setbkmode(int mode); // Set background mode// Color model transformation related functionsCOLORREF RGBtoGRAY(COLORREF rgb);void RGBtoHSL(COLORREF rgb, float *H, float *S, float *L);void RGBtoHSV(COLORREF rgb, float *H, float *S, float *V);COLORREF HSLtoRGB(float H, float S, float L);COLORREF HSVtoRGB(float H, float S, float V);// Drawing related functionsCOLORREF getpixel(int x, int y); // Get pixel colorvoid putpixel(int x, int y, COLORREF color); // Set pixel colorvoid line(int x1, int y1, int x2, int y2); // Draw a linevoid rectangle (int left, int top, int right, int bottom); // Draw a rectangle without fillingvoid fillrectangle (int left, int top, int right, int bottom); // Draw a filled rectangle with a bordervoid solidrectangle(int left, int top, int right, int bottom); // Draw a filled rectangle without a bordervoid clearrectangle(int left, int top, int right, int bottom); // Clear a rectangular regionvoid circle (int x, int y, int radius); // Draw a circle without fillingvoid fillcircle (int x, int y, int radius); // Draw a filled circle with a bordervoid solidcircle(int x, int y, int radius); // Draw a filled circle without a bordervoid clearcircle(int x, int y, int radius); // Clear a circular regionvoid ellipse (int left, int top, int right, int bottom); // Draw an ellipse without fillingvoid fillellipse (int left, int top, int right, int bottom); // Draw a filled ellipse with a bordervoid solidellipse(int left, int top, int right, int bottom); // Draw a filled ellipse without a bordervoid clearellipse(int left, int top, int right, int bottom); // Clear an elliptical regionvoid roundrect (int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // Draw a rounded rectangle without fillingvoid fillroundrect (int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // Draw a filled rounded rectangle with a bordervoid solidroundrect(int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // Draw a filled rounded rectangle without a bordervoid clearroundrect(int left, int top, int right, int bottom, int ellipsewidth, int ellipseheight); // Clear a rounded rectangular regionvoid arc (int left, int top, int right, int bottom, double stangle, double endangle); // Draw an arcvoid pie (int left, int top, int right, int bottom, double stangle, double endangle); // Draw a sector without fillingvoid fillpie (int left, int top, int right, int bottom, double stangle, double endangle); // Draw a filled sector with a bordervoid solidpie(int left, int top, int right, int bottom, double stangle, double endangle); // Draw a filled sector without a bordervoid clearpie(int left, int top, int right, int bottom, double stangle, double endangle); // Clear a rounded rectangular regionvoid