【文件属性】:
文件名称:C语言编写的鼠标的加载
文件大小:2KB
文件格式:RAR
更新时间:2011-12-21 15:04:33
C语言鼠标的加载
#include
#include
#include
#include
/*鼠标信息宏定义*/
#define WAITING 0xff00
#define LEFTPRESS 0xff01
#define LEFTCLICK 0xff10
#define LEFTDRAG 0xff19
#define RIGHTPRESS 0xff02
#define RIGHTCLICK 0xff20
#define RIGHTDRAG 0xff2a
#define MIDDLEPRESS 0xff04
#define MIDDLECLICK 0xff40
#define MIDDLEDRAG 0xff4c
#define MOUSEMOVE 0xff08
int Keystate;
int MouseExist;
int MouseButton;
int MouseX;
int MouseY;
int up[16][16],down[16][16],mouse_draw[16][16],pixel_save[16][16];
void MouseMath()/*计算鼠标的样子*/
{int i,j,jj,k;
long UpNum[16]={
0x3fff,0x1fff,0x0fff,0x07ff,
0x03ff,0x01ff,0x00ff,0x007f,
0x003f,0x00ff,0x01ff,0x10ff,
0x30ff,0xf87f,0xf87f,0xfc3f
};
long DownNum[16]={
0x0000,0x7c00,0x6000,0x7000,
0x7800,0x7c00,0x7e00,0x7f00,
0x7f80,0x7e00,0x7c00,0x4600,
0x0600,0x0300,0x0300,0x0180
};
for(i=0;i<16;i++)
{
j=jj=15;
while(UpNum[i]!=0)
{
up[i][j]=UpNum[i]%2;
j--;
UpNum[i]/=2;
}
while(DownNum[i]!=0)
{
down[i][jj--]=DownNum[i]%2;
DownNum[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)
mouse_draw[i][k]=1;
else if(up[i][k]==0&&down[i][k]==1)
mouse_draw[i][k]=2;
else if(up[i][k]==1&&down[i][k]==0)
mouse_draw[i][k]=3;
else
mouse_draw[i][k]=4;
}
}
mouse_draw[1][2]=4;/*特殊点*/
}
【文件预览】:
C语言鼠标的加载.txt