下载频道> 资源分类> 编程语言 >C源码
实例282 设置文本及背景颜色0
include<conio h>main(){ void *buf; clrscr(); *清除字符屏幕* gotoxy(35,15); *光标定位到(35,15)* textcolor(YELLOW); *设置文本颜色为黄色* textbackground(BLUE); *设置背景颜色为蓝色* cprintf("hello world n"); *输出字符串hello world* cprintf("hello computer n"); *输出字符串hello computer*
上传者:admin 上传时间:2017-07-15
下载次数:11 资源类型:程序源码
实例281 相同图案的输出0
include <graphics h> include <stdlib h> include <conio h>void main(){ int gdriver, gmode; unsigned size; void *buf; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形界面初始化* setcolor(15); *设置绘图颜色为白色* rectangle(20, 20, 200, 200); *画正方形* setcolor(RED); *设置
上传者:admin 上传时间:2017-07-15
下载次数:80 资源类型:程序源码
实例280 输出不同字体0
include <stdio h> include <graphics h> include <time h>int main(){ int i, gdriver, gmode; time_t curtime; char s[30]; gdriver = DETECT; time(&curtime); initgraph(&gdriver, &gmode, ""); *图形方式初始化* setbkcolor(BLUE); *设置屏幕背景颜色为蓝色* cleardevice(); *清屏* setviewport(1
上传者:admin 上传时间:2017-07-15
下载次数:12 资源类型:程序源码
实例279 彩色扇形0
include <graphics h>void main(){ int gdriver, gmode; int i, start, end; *设置变量为基本整型* gdriver = DETECT; initgraph(&gdriver, gmode, ""); *图形方式初始化* start = 0; *start赋初值为0&deg;* end = 45; *end赋初值为45&deg;* for (i = 0; i < 8; i++) { setfillstyle(S
上传者:admin 上传时间:2017-07-15
下载次数:5 资源类型:程序源码
实例278 颜色变换0
include <graphics h>void main(void){ int color; *定义变量color为基本整型* int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形方式初始化* for (color = 0; color <= 14; color++) { setbkcolor(color); *设置背景颜色* getch(); } closegraph();}
上传者:admin 上传时间:2017-07-15
下载次数:9 资源类型:程序源码
实例277 绘制五角星0
include <graphics h> include <math h>main(){ int i, j = 0, gdriver, gmode, points[20]; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形方式初始化* setcolor(YELLOW); *设置绘图颜色* setlinestyle(0, 0, 1); *设置线形* for (i = 0; i < 5; i++) { points[j++] = (int)(
上传者:admin 上传时间:2017-07-15
下载次数:6 资源类型:程序源码
实例276 绘制红色间隔点填充的多边形0
include <graphics h>void main(){ int gdriver, gmode, n; int points[] = { 200, 200, 150, 250, 150, 300, 200, 350, 250, 350, 300, 300, 300, 250, 250, 200 }; *定义数组存放顶点坐标* gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形方式初始化* setfillstyle(
上传者:admin 上传时间:2017-07-15
下载次数:11 资源类型:程序源码
实例275 绘制黄色网格填充的椭圆0
include <graphics h>main(){ int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形方式初始化* setcolor(RED); *设置绘图颜色为红色* ellipse(320, 240, 0, 360, 160, 80); *在屏幕中心绘制一椭圆* setfillstyle(7, 14); *设置填充类型及颜色* floodfill(320, 240, RED); *对椭圆进行填充* getch(); closegraph(); *退出图形状态* }
上传者:admin 上传时间:2017-07-15
下载次数:5 资源类型:程序源码
实例274 绘制彩带0
include <graphics h> include <math h> define PI 3 1415926void main(){ double a; int x1, x2, j = 1, color = 1; int gdriver = DETECT, gmode; initgraph(&gdriver, &gmode, ""); cleardevice(); for (a = 1; a <= 600; a +=1) { setcolor(color); x1 = 220+100 * cos(a 47
上传者:admin 上传时间:2017-07-15
下载次数:10 资源类型:程序源码
实例273 绘制正弦曲线0
include <conio h> include <math h> include <graphics h>main(){ int y = 200; int i, h; float m; int gdriver, gmode; gdriver = DETECT; initgraph(&gdriver, &gmode, ""); *图形方式初始化* setviewport(50, 50, 450, 450, 1); *设定图形窗口* setcolor(14); *设置绘图颜色为黄色* rectang
上传者:admin 上传时间:2017-07-15
下载次数:10 资源类型:程序源码
关于我们| 联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款账号| 法律顾问| 合作伙伴| 付款方式|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘 博客客服
沪 ICP 证 14049794 号
谷速代码 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved