Techknow Study

Graphics program

8:58:00 PM vikas 0 Comments Category :


 Graphics program

A simple graphics program to show the position of mouse pointer in drawn bar.
This program show the position co-ordinate of mouse pointer with click also.
The program comes out from output window when you hit any key on keyboard.




#include<conio.h>
#include<graphics.h>
#include<dos.h>
union REGS i,o;
Void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,” ”);
bar(1,1,300,300);
i.x.ax=1;
while(!kbhit())
{
int86(0x33,&i,&o);
i.x.ax=3;
int86(0x33,&i,&o);
{
Printf(x=%03d y=%03d click=%03d,o.x.cx,o.x.dx,o.x.bx);
int86(0x33,&i,&o);
gotoxy(10,3);
}
}
getch();
}

RELATED POSTS

0 comments