C Program to Draw Resistance using Graphics Function

C Program to Draw Resistance using Graphics Function.


C Program to Draw Resistance using Graphics Function Images-Pictures-Pis-Photos-Basic C Programs-C Language Programs-C Program to draw a Resistor in Graphics Mode-General C Programs-Program for Resistor-Resistor Program-Graphics Programs.

InitGraph initializes the graphics system by loading a graphics driver from disk then putting the system into graphics mode

outtextxy(x,y,"Resistor");

It is similar to printf statement. Prints text on a screen in Text Mode while outtextxy( ) function prints Text onto screen in Graphics Mode. This function accepts 3 parameters.

X Co-ordinate - Specifies X Co-ordinate

Y Co-ordinate - Specifies Y Co-ordinate

Text - String/Text to be printed on the specified Co-ordinates.

closegraph( ) function switches back the screen from graphics mode to text mode.


--------------------------------------------------------------------------------------------------------------------------

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main( )
{
    int gd = DETECT,gm;
    initgraph(&gd, &gm,, "c:\\tc\\bgi");
    line(90,100,100,100);
    line(100,100,110,120);
    line(110,120,120,100);
    line(120,100,130,120);
    line(130,120,140,100);
    line(140,100,150,120);
    line(150,120,160,100);
    line(160,100,170,100);
    outtextxy(100,130,"Resistor");
    getch( );
    closegraph( );
}

--------------------------------------------------------------------------------------------------------------------------

Output

--------------------------------------------------------------------------------------------------------------------------

Displays the Resistor


EmoticonEmoticon