当前位置:三九宝宝网 → 宝宝教育 → 教学论文 → 正文

C图形界面编程

更新:12-25 整理:39baobao.com
字体:

[中班有趣的图形科学活动教案是什么版本]1. 《有趣的图形》是人教版幼儿美术。 2. 活动目标 通过对比,让幼儿感知圆形、三角形、正方形的基本特征,能够区分三种几何图形。通过创设愉悦的游戏情节,运用多种感观来调动幼...+阅读

说心里话,我以前也喜欢c的,不过太难了.这是一点东西.你可以实验以下的.c里的函数太多,你可以到新华书店去找书的,很多那方面的书.都很好,不过建议你学其他的语言,函数名: line 功 能: 在指定两点间画一直线 用 法: void far line(int x0, int y0, int x1, int y1); 程序例: #include #include #include #include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int xmax, ymax; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } setcolor(getmaxcolor()); xmax = getmaxx(); ymax = getmaxy(); /* draw a diagonal line */ line(0, 0, xmax, ymax); /* clean up */ getch(); closegraph(); return 0; } 函数名: linerel 功 能: 从当前位置点(CP)到与CP有一给定相对距离的点画一直线 用 法: void far linerel(int dx, int dy); 程序例: #include #include #include #include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; char msg[80]; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } /* move the C.P. to location (20, 30) */ moveto(20, 30); /* create and output a message at (20, 30) */ sprintf(msg, " (%d, %d)", getx(), gety()); outtextxy(20, 30, msg); /* draw a line to a point a relative distance away from the current value of C.P. */ linerel(100, 100); /* create and output a message at C.P. */ sprintf(msg, " (%d, %d)", getx(), gety()); outtext(msg); /* clean up */ getch(); closegraph(); return 0; } 函数名: circle 功 能: 在给定半径以(x, y)为圆心画圆 用 法: void far circle(int x, int y, int radius); 程序例: #include #include #include #include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ } midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor()); /* draw the circle */ circle(midx, midy, radius); /* clean up */ getch(); closegraph(); return 0; } 函数名: cleardevice 功 能: 清除图形屏幕 用 法: void far cleardevice(void); 程序例: #include #include #include #include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ } midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor()); /* for centering screen messages */ settextjustify(CENTER_TEXT, CENTER_TEXT); /* output a message to the screen */ outtextxy(midx, midy, "press any key to clear the screen:"); /* wait for a key */ getch(); /* clear the screen */ cleardevice(); /* output another message */ outtextxy(midx, midy, "press any key to quit:"); /* clean up */ getch(); closegraph(); return 0; }

本文地址:https://www.39baobao.com/show/29_15239.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.

以下为关联文档:

小班数学:送图形宝宝回家教案设计去文库,查看完整内容> 内容来自用户:临海听涛78 小班数学:《送图形宝宝回家》教案设计 -  [活动目标] 1、让幼儿认识图形(正方形、圆形、三角形)。 2、让幼儿能正确的分辨正方形...

幼儿园小班五领图形教案活动目标: 1、通过拼摆图形,巩固对圆形、三角形、正方形、长方形的基本特征的掌握,能够区分四种几何图形。 2、通过创设愉悦的游戏情节,发展幼儿的观察力及创造性思维。 3、激发...

大班认识图形里面数字宝宝教案数字变化后、给数字宝宝排序(提示顺序。 3? 五:1,双数) 0123456789 9876543210 13579 2468 2,幼儿数出:数字宝宝的组合图形 幼儿逐一观察每个有数字宝宝组成的图形: 一:数字宝宝 教...

C语言图形界面登陆框会要求你自行建立对话框资源,并定义框体坐标,并且要求建立相应的对象来操作这些资源,如果你对MFC一无所知,我最好用一个以弹出菜单来响应鼠标事件为例给你讲解: 文件->新...

c语言怎样编图形界面#include #include #define PI 3.1415926 void main() { double a; int x,y,y1,r,r1; int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,"c:\\turboc2\\bgi"); printf("Pl...

C语言图形界面怎么做出来这是最简单的界面程序 : // c++.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "c++.h"#define MAX_LOADSTRING 100// 全局变量:HINSTANCE hInst; // 当前实例 TCHAR...

C语言图形界面的编写windows程序设计第五版 vc98时代经典必看 精通Windows API-函数、接口、编程实例 vc08新一点 LabWindows/CVI虚拟仪器设计技术 labview的师兄 gtk+2.0编程范例 虽然只讲linu...

求c语言实现图形界面c c c语言都可以那得学习windows编程了。。。用VC6.0新建一个wn32程序,而不DOS程序,输入如下代码即可:#include#include#include#includeint g_nYPos = 200; //文字的Y坐标 long WINAPI WndProc...

c语言图形界面简单计算器源代码急求你好!怎么出现了同样的提问?是一个学校的吧#include#include#includeint main() { int y; double shu1=0; double shu2=0; char yn; do { printf("|--------------------------...