Here I am just giving some C graphics source codes so that you can you it for your projects. All these C source codes are made by me and no problem that you can use it as you wish. In all the programs the graphics initialisation is different So if your Turbo C installed on F drive then you change the graphics option as
 initgraph(&gd,&gm, "f:\\tc\\bgi"); or initgraph(&gd,&gm," ");
 rest program remains the same.    For more about C graphics see
 book
 
C graphics by Yashavant Kanetkar .You can get all these source codes from my e-book Parallel Port
   

TEST RESULT WINDOW

This code is  published on http://www.sourcecodesworld.com/ in C graphics section,but they changed my code.All these are compiled on Turbo C3.0

#include<graphics.h>
#include<dos.h>
#include<stdio.h>
void mainscreenin17404(int sx,int sy,int ex,int ey);
void mainscreenin27404(int sx,int sy,int ex,int ey);
void dia7404();
void main()
{
int gd=DETECT,gm;
int sx,sy,ex,ey;
initgraph(&gd,&gm,"e:\\tc\\bgi");
sx=15;
sy=10;
ex=630;
ey=470;
mainscreenin17404(sx,sy,ex,ey);
mainscreenin27404(sx,sy,ex,ey);
dia7404();
getch();
}
void mainscreenin17404(int sx,int sy,int ex,int ey)
{
setfillstyle(1,7);
bar(sx,sy,ex,ey);
setfillstyle(1,7);
setcolor(15);
line(sx,sy,sx,ey);
line(sx,sy,ex,sy);
line(sx,sy,sx,ey);
line(sx,sy,ex,sy);

setcolor(0);
line(ex,sy,ex,ey);
line(ex,sy,ex,ey);
line(sx,ey,ex,ey);
line(sx,ey,ex,ey);
settextstyle(0,0,0);
setfillstyle(1,1);
bar(sx+2,sy+2,ex-2,sy+20);
setcolor(13);
settextstyle(8,0,1);
outtextxy(sx+190,sy-5,"IC 7404-NOT GATE");
//for x
setfillstyle(1,7);
bar(ex-15,sy+4,ex-4,sy+15);
setcolor(15);
line(ex-15,sy+4,ex-4,sy+4);
line(ex-15,sy+4,ex-15,sy+15);
setcolor(0);
line(ex-15,sy+15,ex-4,sy+15);
line(ex-4,sy+4,ex-4,sy+15);
setcolor(1);
settextstyle(0,0,1);
outtextxy(ex-13,sy+5,"x");
setfillstyle(1,7);
}
void mainscreenin27404(int sx,int sy,int ex,int ey)
{
sx=sx+15;
sy=sy+24;
ex=ex-17;
ey=ey-9;

setcolor(0);
line(sx,sy,sx,ey);
line(sx,sy,ex,sy);
line(sx,sy,sx,ey);
line(sx,sy,ex,sy);
setcolor(15);
line(ex,sy,ex,ey);
line(ex,sy,ex,ey);
line(sx,ey,ex,ey);
line(sx,ey,ex,ey);
}
void dia7404()
{
int x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,i;
setcolor(0);
rectangle(61,83,404,259);//body
setfillstyle(1,9);
floodfill(107,137,0);
arc(62,166,270,90,16);
setfillstyle(1,6);
floodfill(68,165,0);
//for drawing leads
x1=82;
y1=67;
x2=104;
y2=83;
x3=93;
y3=73;
for(i=0;i<7;i++)//for upper part
{
rectangle(x1,y1,x2,y2);

x1+=46;
x2+=46;
setfillstyle(1,14);
floodfill(x3,y3,0);
x3+=46;
}
x1=82;
y1=259;
x2=104;
y2=275;
x3=92;
y3=267;
for(i=0;i<7;i++)//for lower part
{
rectangle(x1,y1,x2,y2);
x1+=46;
x2+=46;
setfillstyle(1,14);
floodfill(x3,y3,0);
x3+=46;
}
//end of ic's pin
//start of ic internal configuration
x1=94;
y1=259;
y2=250;
x2=80;
y3=213;
x3=100;
x4=147;
y4=213;
x5=157;

y5=250;
x6=137;
y6=259;
for(i=0;i<3;i++)
{
line(x1,y1,x1,y2);
line(x2,y2,x1,y2);
line(x2,y2,x2,y3);
line(x2,y3,x3,y3);
line(x4,y4,x5,y4);
line(x5,y4,x5,y5);
line(x5,y5,x6,y5);
line(x6,y6,x6,y5);
x1+=95;
x2+=95;
x3+=95;
x4+=95;
x5+=95;
x6+=95;
}
x1=100;
y1=191;
y2=236;
x3=137;
y3=213;
x4=129;//x4,y4 for floodfill
y4=212;
x5=142;
y5=213;//x5,y5 for bubble
for(i=0;i<3;i++)
{

line(x1,y1,x1,y2);
line(x1,y1,x3,y3);
line(x1,y2,x3,y3);
circle(x5,y5,5);
setfillstyle(1,4);
floodfill(x4,y4,0);
floodfill(x5,y5,0);
x1+=95;
x2+=95;
x3+=95;
x4+=95;
x5+=95;
}
x1=139;
y1=83;
y2=92;
x2=127;
y3=129;
x3=147;
x4=193;
y4=129;
x5=204;
y5=92;
x6=184;
y6=83;
for(i=0;i<3;i++)
{
line(x1,y1,x1,y2);
line(x2,y2,x1,y2);
line(x2,y2,x2,y3);
line(x2,y3,x3,y3);
line(x4,y4,x5,y4);

line(x5,y4,x5,y5);
line(x5,y5,x6,y5);
line(x6,y6,x6,y5);
x1+=95;
x2+=95;
x3+=95;
x4+=95;
x5+=95;
x6+=95;
}//for upper part lining
x1=147;
y1=106;
y2=151;
x3=183;
y3=129;
x4=161;
y4=127;
y5=129;
x5=188;
for(i=0;i<3;i++)
{
line(x1,y1,x1,y2);
line(x1,y1,x3,y3);
line(x1,y2,x3,y3);
circle(x5,y5,5);
setfillstyle(1,4);
floodfill(x4,y4,0);
floodfill(x5,y5,0);
x1+=95;
x2+=95;
x3+=95;
Page no:52
x4+=95;
x5+=95;
}
outtextxy(92,266,"1");
outtextxy(81,289,"I1");
outtextxy(137,267,"2");
outtextxy(128,289,"Y1");
outtextxy(185,267,"3");
outtextxy(176,289,"I2");
outtextxy(229,268,"4");
outtextxy(222,289,"Y2");
outtextxy(275,268,"5");
outtextxy(268,289,"I3");
outtextxy(319,268,"6");
outtextxy(313,289,"Y3");
outtextxy(365,268,"7");
outtextxy(351,289,"GND");
outtextxy(85,77,"14");
outtextxy(75,60,"Vcc");
outtextxy(133,77,"13");
outtextxy(127,54,"I6");
outtextxy(182,76,"12");
outtextxy(174,54,"Y6");
outtextxy(227,75,"11");
outtextxy(222,54,"I5");
outtextxy(273,74,"10");
outtextxy(268,54,"Y5");
outtextxy(320,74,"9");
outtextxy(313,54,"I4");
outtextxy(363,75,"8");
outtextxy(357,54,"Y4");
settextstyle(1,0,4);

setlinestyle(0,0,3);
setcolor(15);
line(440,60,599,60);
line(440,60,440,280);
setcolor(0);
line(440,280,599,280);
line(599,280,599,60);
setlinestyle(1,0,1);
setfillstyle(1,0);
setcolor(0);
bar(447,63,592,90);
settextstyle(1,0,1);
setcolor(14);
outtextxy(460,68,"RESULTS");
setcolor(2);
for(y1=102,i=0;i<6;i++)
{
circle(462,y1,10);
setfillstyle(1,4);
floodfill(462,y1,2);
y1+=30;
}
setcolor(15);
setlinestyle(0,0,1);
line(80,350,150,350);
line(80,350,80,400);
setcolor(0);
line(80,400,150,400);
line(150,400,150,350);
outtextxy(90,360,"Index");
setcolor(15);

line(200,350,270,350);
line(200,350,200,400);
setcolor(0);
line(200,400,270,400);
line(270,400,270,350);
setcolor(0);
outtextxy(210,360,"Save");
setcolor(15);
line(320,350,390,350);
line(320,350,320,400);
setcolor(0);
line(320,400,390,400);
line(390,400,390,350);
outtextxy(330,360,"Exit");
setlinestyle(0,0,3);
setcolor(15);
line(420,310,600,310);
line(420,310,420,440);
setcolor(0);
line(420,440,600,440);
line(600,440,600,310);
bar(422,312,596,340);
setcolor(14);
outtextxy(425,317,"Truth Table");
setcolor(MAGENTA);
setlinestyle(0,0,1);
line(450,350,580,350);
line(450,350,450,430);
line(450,430,580,430);
line(580,430,580,350);
line(510,350,510,430);
setcolor(BROWN);

settextstyle(0,0,1);
outtextxy(460,360,"INPUT");
outtextxy(520,360,"OUTPUT");
setcolor(MAGENTA);
line(450,370,580,370);
line(450,400,580,400);
setcolor(12);
outtextxy(480,380,"H");
outtextxy(540,380,"L");
outtextxy(480,410,"L");
outtextxy(540,410,"H");
}


Hosted by www.Geocities.ws

1