Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103550839
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: C/C++

2008-05-25 00:04:18

原帖及讨论:

/***********************************************************************
                ╭═══════════════╮
                ║                              ║
  ╭══════┤            清清凉            ├══════╮
  ║            ║                              ║            ║
  ║            ╰═══════════════╯            ║
 ║                                                          ║
 ║                                                          ║
 ║ 声明:本程序由清清凉修改整理                            ║
  ║  说明:                                                  ║
  ║                                                          ║
  ║      交流群:31545052 (唯C联盟)                     ║
  ║      计算机编程交流群:31544991                          ║
 ║      本人QQ:527274766                                   ║
  ║                                多多交流,共同进步!      ║
  ║                                   —— 0501xql           ║
  ║                                                          ║
  ║    ╭───────────────────────╮    ║
  ╰══┤       E-mail:                ├══╯
        ╰───────────────────────╯
***********************************************************************/


   /* -----  图形模式编程,个性鼠标。 -----*/

int Msinit()
{   /* 初始化鼠标*/
    int recored;

    regs.x.ax=0;
    int86(0x33,®s,®s);
    recored=regs.x.ax;
    if(recored==0)
    {   printf("Mouse not found !\n");
        getch();return 0;
    }
    regs.x.ax = 1;  /* 显示鼠标*/
    int86(0x33,®s,®s);
    return recored;
}

void MskindMath()    /*计算鼠标的样子*/
{   /*Point hotspot[]={{0,11},{0,0},{4,0},{4,0}};热点*/
    int    i,j,jj,k;
    int    full,kind;
    long   UpNum[2][16] = {/*  hand */
        0xf3ff,0xe1ff,0xe1ff,0xe1ff,
        0xe001,0xe000,0xe000,0xe000,
        0x8000,0x0000,0x0000,0x0000,
        0x0000,0x0000,0x8001,0xc003,

        0x3fff,0x1fff,0x0fff,0x07ff,/*  arrow箭头 */
        0x03ff,0x01ff,0x00ff,0x007f,
        0x003f,0x00ff,0x01ff,0x10ff,
        0x30ff,0xf87f,0xf87f,0xfc3f,
    };
    long   DownNum[2][16]={/*  hand */
        0x0c00,0x1200,0x1200,0x1200,
        0x13fe,0x1249,0x1249,0x1249,
        0x7249,0x9001,0x9001,0x9001,
        0x8001,0x8001,0x4002,0x3ffc,

        0x0000,0x4000,0x6000,0x7000,/*  arrow箭头 */
        0x7800,0x7c00,0x7e00,0x7f00,
        0x7f80,0x7e00,0x7c00,0x4600,
        0x0600,0x0300,0x0300,0x0180,
    };
    kind = (Mskind>>1)%2;  /* 手形还是箭头*/
    full = Mskind%2;       /* 是否空心*/

    for(i=0;i<16;i++)
    {
         j=jj=15;
         while(UpNum[kind][i]!=0)
         {
             up[i][j]=UpNum[kind][i]%2;
             j--;
             UpNum[kind][i]/=2;
         }
         while(DownNum[kind][i]!=0)
         {
             down[i][jj--]=DownNum[kind][i]%2;
             DownNum[kind][i]/=2;
         }
         for(k=j ;k>=0;k--)  up  [i][k]=0;
         for(k=jj;k>=0;k--)  down[i][k]=0;
         for(k=0;k<16;k++)
         {   /*四种组合方式*/
             if(up[i][k]==0&&down[i][k]==0)
             {   /* 是否为空心*/
                 if(full) mouse_draw[i][k]=1;
                 else     mouse_draw[i][k]=2;
             }

阅读(917) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~