C / graphics.h / settextjustify
arc, bar, bar3d, circle, cleardevice, clearviewport, closegraph, detectgraph, drawpoly, ellipse, fillellipse, fillpoly, floodfill, getarccoords, getaspectratio, getbkcolor, getcolor, getdefaultpalette, getdrivername, getfillpattern, getfillsettings, getgraphmode, getimage, getlinesettings, getmaxcolor, getmaxmode, getmaxx, getmaxy, getmodename, getmoderange, getpalette, getpalettesize, getpixel, gettextsettings, getviewsettings, getx, gety, graphdefaults, grapherrormsg, _graphfreemem, _graphgetmem, graphresult, imagesize, initgraph, installuserdriver, installuserfont, line, linerel, lineto, moverel, moveto, outtext, outtextxy, pieslice, putimage, putpixel, rectangle, registerbgidriver, registerbgifont, restorecrtmode, sector, setactivepage, setallpalette, setaspectratio, setbkcolor, setfillpattern, setfillstyle, setgraphbufsize, setgraphmode, setlinestyle, setpalette, setrgbpalette, » settextjustify, settextstyle, setusercharsize, setviewport, setvisualpage, setwritemode, textheight, textwidth,
Funcion: settextjustify()
Sintaxis:
Descripcion: Esta función es usada para especificar el método en el cual el texto es colocado en la pantalla con relación a la posición del cursor. El argumento horizontal define la justificación horizontal, mientras que el argumento vertical indica la justificación vertical.
Existen varios valores y constantes para las justificaciones.
Ejemplo:
Sintaxis:
void far settextjustify(int horizontal, int vertical);
Descripcion: Esta función es usada para especificar el método en el cual el texto es colocado en la pantalla con relación a la posición del cursor. El argumento horizontal define la justificación horizontal, mientras que el argumento vertical indica la justificación vertical.
Existen varios valores y constantes para las justificaciones.
Ejemplo:
#include <graphics.h> #include <conio.h> int main() { int gdriver = EGA; int gmodo = EGAHI; /* Si has registrado los dispositivos para que formen parte de graphics.lib ** entonces usa estas sentencias: registerbgidriver( EGAVGA_driver ); initgraph( &gdriver, &gmodo, "" ); */ /* Si no, entonces has de "decir" dónde se encuentra el dispositivo gráfico */ initgraph( &gdriver, &gmodo, "C:\\BC5\\BGI" ); settextjustify( RIGHT_TEXT, BOTTOM_TEXT ); moveto(300, 200); outtext( "(RIGHT_TEXT, BOTTOM_TEXT)" ); settextjustify( RIGHT_TEXT, TOP_TEXT ); moveto(300, 200); outtext( "(RIGHT_TEXT, TOP_TEXT)" ); settextjustify( LEFT_TEXT, BOTTOM_TEXT ); moveto(300, 200); outtext( "(LEFT_TEXT, BOTTOM_TEXT)" ); settextjustify( LEFT_TEXT, TOP_TEXT ); moveto(300, 200); outtext( "(LEFT_TEXT, TOP_TEXT)" ); setcolor( 1 ); line( 300, 200, 300, 100 ); setcolor( 2 ); line( 300, 200, 300, 300 ); setcolor( 3 ); line( 300, 200, 100, 200 ); setcolor( 4 ); line( 300, 200, 500, 200 ); getch(); closegraph(); return 0; }