#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,&regs,&regs);
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;
}

最新文章

  1. JavaScript学习总结(三)——this、原型、javascript面向对象
  2. 如何搞定IE+google双内核的360浏览器表单自动回填兼容问题
  3. 【leetcode】Palindrome Number
  4. Hibernate 检索策略
  5. rm -rf删除过多文件提示参数过长
  6. TopFreeTheme精选免费模板【20130617】
  7. html JS打印添加水印图片
  8. js变量作用域
  9. php生成数据字典,代码
  10. Eclipse 在线安装fat jar插件
  11. 纯CSS3模拟星体旋转效果
  12. FireDac 同时连接SQLserver2000时出现 Connection is busy with results for another command
  13. noteless的博客导航页 所有文章的导航页面
  14. 2018.12.21 浪在ACM 集训队第十次测试赛
  15. vue组件导航栏动态添加class
  16. Python3集合
  17. Android五种数据存储方式
  18. &lt;转&gt;LUA语法分析
  19. memcache面试题汇总
  20. 51nod 1019 逆序数(逆序数+离散化)

热门文章

  1. 记录下httpclient 发送请求 服务端用@RequestBody 自动接收参数 报415
  2. java中Arrays和Collections等工具类
  3. dataGridView的使用经验
  4. CollectionUtils工具类使用指南
  5. Thrift之java实例
  6. (效果五)js获取客户端ip地址及浏览器信息
  7. K-means聚类分析MATLAB代码
  8. 21天学通C++_Day3_Part3
  9. yield 与生成器
  10. webpack新版本4.12应用九(配置文件之使用不同语言进行配置)