![]() |
Program to plot pixels 1 Attachment(s) Program to plot pixels #include #include #include #include void main (int) { int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection. int midx,midy,x; //Initializing graphics and local variables. initgraph(&gdriver,&gmode,"d:\\bc3\\bgi"); //Reading result of initialization. errorcode=graphresult(); if(errorcode!=grOk) //An error occurred. { printf("Graphics error occurred : %s \n",grapherrormsg(errorcode)); printf("Press any key to stop : "); getch(); exit(1); //Terminate the program due to error. } for(x=40;x<120;x=x+10) { putpixel(x,200,14); //Plots 1 pixel at position(x,200) with YELLOW color(14) getch(); } } |
| All times are GMT +5. The time now is 10:07 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.