#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<stdio.h>
#include<stdlib.h>
#include<process.h>
void status(int * ,int * ,int * );
void cursor(int ,int );void main()
{ int gd=DETECT,gm,i;
initgraph(&gd,&gm,"F:\\BORLANDC\\BGI");
int x,y,button;
char KEY;
int size;
void * buffer; setbkcolor(7);
size=imagesize(0,0,150,150);
buffer=(int *)malloc(size); if(buffer==NULL)
{ closegraph();
restorecrtmode(); printf("Not Enough Memory"); exit(1); }
while(1)
{ status(&x,&y,&button); getimage(x-2,y-2,x+6,y+6,buffer);
cursor(x,y); putimage(x-1,y-1,buffer,0);
free(buffer); if(kbhit())
{ KEY=getch(); if(KEY==27) break; }
}}union REGS regs;void status(int * sx,int * sy,int * sbutton)
{ regs.x.ax=3;
int86(0x33,®s,®s); * sx=regs.x.cx;
* sy=regs.x.dx;
* sbutton=regs.x.bx;
}
void cursor(int cx,int cy)
{ setcolor(15);
setfillstyle(1,15);
moveto(cx-2,cy-2);
linerel(0,6);
linerel(2,-2);
linerel(4,4);
linerel(2,-2);
linerel(-4,-4);
linerel(2,-2);
linerel(-6,0);
floodfill(cx,cy,15);}
各位高手,这是我编的让鼠标移动的函数,目地是让鼠标移动就可以了,但是移动过后不能留痕迹,只保留当前鼠标的痕迹,但是使用getimage函数时,C编程软件自动退出了,问题出在getimage,求原因及解释,不甚感激!!!
你发错版块了,这里是C#版块的,在这里混的大部分都对C\C++不感冒的
20年前做过,具体函数早忘了
getimage 具体实现有吗?