outtextxy function in c graphic

outtextxy is the function used to display the given string on graphics mode at specific position . outtextxy function takes 3 argument, first two as int type which specify the position of string on screen. And last argument is char type which is text or string which display on screen.
                                        outtextxy function use its default font style to display given string . To change font style we need to use settextstyle function before the outtextxy function.
                                        outtextxy function is an alternative of outtext function which specify particular location of string or text on the screen.

General syntax of outtextxy function is : 
outtextxy(int x-pos, int y-pos, char *string);

C graphics program to demonstrate outtextxy function.


#include <graphics.h>
#include <stdio.h>



int main( )
{
    int gd=DETECT, gm;
    char msg[]="Demonstration of outtextxy function";
    initgraph(&gd,&gm,"C:\\tc\\bgi");

    setbkcolor(8);

    outtextxy(200,130,"Programmingcampus.com");

    outtextxy(200,170,msg);

    getch();
    closegraph();

    return 0;
}


outtextxy function of c graphics

Download


0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.