beijing
2024-10-09 04:57:08
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<graphics.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
int init;
int read_mouse;
void cursor;
void newxy;
int main()
{
int buttons,x,y;
char str[];
int driver=VCA;
int moede=VGAHT;
initgraph(&gdriver,&mode,"");
cleardevice();
rectangle(,,,);
setfillstyle(,);
circle(,,);
x=,y=;
cursor(x,y);
for(;;)
{ newxy(&x,&y,&butttons);
if(x>=&&x<=&&y>=&&y<=&&buttons)
{
cleardevice();
closegraph();
exit();
}
}
}
void(int x,int y)
{ int x1,x2,y1,y2;
x1=x-;
x2=x+;
y1=y-;
y2=y+;
line(x1,y,x2,y);
line(x,y1,x,y2);
}
int read_mouse(int*mx,int*my,int*mbutton)
{
union REGS regs;
int x0=*mx,y0=*my,button0=*mbutton;
int xnew,ynew;
do
{
regs.x.ax=;
int86(0x33,®s,®s);
xnew=regs.x.cx;
ynew=regs.x.dx;
*mbutton=regs.x.bx;
}
while(xnew==x0&&ynew==y0&&*mbutton==button0);
*mx=xnew;
*my=ynew;
switch(*mbutton)
{ case :
return ;
case :
return ;
case :
return ;
case :
return3;
default :
return4;
}
}
void newxy(int *mx,int *my,int *mbutt)
{ int ch,xx0=*mx,yy0=*my;
int xm,ym;
ch=read_mouse(&xm,&ym,mbutt);
curse(xx0,yy0);
curse(xm,xy);
switch(ch)
{ case : break;
case : cirse(xm,ym,);break;
case : rectangle(xm-,ym-,xm+,ym+);break;
default : putpixel(xm,ym,);break;
}
*mx=xm;
*my=ym;
}
最新文章
- JavaScript学习总结(三)——this、原型、javascript面向对象
- 如何搞定IE+google双内核的360浏览器表单自动回填兼容问题
- 【leetcode】Palindrome Number
- Hibernate 检索策略
- rm -rf删除过多文件提示参数过长
- TopFreeTheme精选免费模板【20130617】
- html JS打印添加水印图片
- js变量作用域
- php生成数据字典,代码
- Eclipse 在线安装fat jar插件
- 纯CSS3模拟星体旋转效果
- FireDac 同时连接SQLserver2000时出现 Connection is busy with results for another command
- noteless的博客导航页 所有文章的导航页面
- 2018.12.21 浪在ACM 集训队第十次测试赛
- vue组件导航栏动态添加class
- Python3集合
- Android五种数据存储方式
- <;转>;LUA语法分析
- memcache面试题汇总
- 51nod 1019 逆序数(逆序数+离散化)