Pages

OUTTEXTXY AND SETTEXTSTYLE

आज के इस Advance Learning Tutorial  में आप graphics मोड में किसी भी string को कैसे print करना है यह सीखेंगे । 

              Graphics mode में किसी भी string को प्रिंट करने के लिए एक function दिया गया है जिसे outtextxy कहते है । 

Prototype :- 

                  outtextxy (int x , int y , "your text here");

Note-: यह function केवल graphics mode पर work करता है । 

              int x and y current position को point करता है  तथा यह pixel form में होता है । 

Example :-

  outtextxy(10 , 10 , "Welcome in advance learning tutorial");

धीयन दें outtextxy character के current font , current direction और current size को use करता है । 

किसी भी text की इन तीनो characteristics को सेट करने के लिए function settextstyle() का use करते है । 

Prototype:-


               settextstyle(int font , int direction , int charsize);

settextstyle text के font ,direction एंड char size को set करता है । 

Note :-  

                 इस function को outtextxy function से पहले call करना होता है नहीं तो text पर कोई effect नहीं पड़ेगा और output same ही आएगा । 
                 C++ का graphics system 8x8 के bit mapped font system को support करता है । 

Directions:- 

यह दो तरह की directions को support करता है । 
  1. Horizontal text (left to right )
  2. Vertical text (right to left )
By default direction , horizontal direction होती है । horizontal direction के लिए value zero (0) तथा vertical direction के लिए value one (1) पास करते है । 

Char Size:- 

यह भी एक integer वैल्यू है । आप text की size को 10 times तक बड़ा सकते है । starting value 0 होती है जैसे जैसे आप value बढ़ाते जायेगे फॉण्ट की size बढ़ती जाएगी । 

Example:- 

                               settextstyle(8,0,3);
                               setcolor("YELLOW");
                               outtextxy(150,180,"Programming world");


Advance learning Tutorial में आज के लिए बस इतना ही । आगे हम  कुछ और इंटरेस्टिंग function के बारे में सीखेंगे । और C++ में class and objects के बारे में भी जानेंगे ।