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

📄 drawbox.c

📁 c语言开发方面的经典问题,包括源代码.c语言开发所要注意的问题,以及在嵌入式等各方面的应用
💻 C
字号:
/* * File: drawbox.c * --------------- * This program draws a box on the screen. */#include <stdio.h>#include "genlib.h"#include "graphics.h"/* Function prototypes */void DrawBox(double x, double y, double width, double height);/* Main program */main(){    InitGraphics();    DrawBox(0.5, 0.5, 1.0, 1.0);}/* * Function: DrawBox * Usage: DrawBox(x, y, width, height) * ----------------------------------- * This function draws a rectangle of the given width and * height with its lower left corner at (x, y). */void DrawBox(double x, double y, double width, double height){    MovePen(x, y);    DrawLine(0, height);    DrawLine(width, 0);    DrawLine(0, -height);    DrawLine(-width, 0);}

⌨️ 快捷键说明

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