biblioteca+

Biblioteca gráfica de C++

 C ++ Proporciona una biblioteca de funciones graficas (GRAFHISCS.H) como suplemento alas bibliotecas de los modelos de memoria estándar, incorporado bibliotecas que son especificas del modelo de memoria. Al utilizar el entorno de desarrollo integrado de c++.se produce la carga automática del modelo de memoria adecuado, que con incide con el modelo de memoria seleccionado (consulte el menú que se abre abajo optians/copiler/Medel). La biblioteca grafica, sin embargo, esta separada y no queda incluida automáticamente en tiempo de coplilacion. Por este motivo existen otras dos opciones de utilización de las funciones graficas con c++; la utilización de los archivos .prj o la incorporación de GRAFHICS.LIB e una o mas de las biblioteca estándar.

 Recuerde que el archivo de cabecera para gráficos debe ser referido en cada uno de los códigos fuentes antes de utilizar cualquier función grafica. En ese caso. La línea fuente #include debería aprender en todo los módulos del código. Además, las funciones graficas no funcionaria sise utiliza el modelo de memoria TINY, dada su limitación de memoria. Los modelos con más memoria dejan mayor Cantidad de esta para los programas del usuario

**FUNCIONES DE LA LIBRERÍA GRAFICA DE TURBO C++ ** **arc : ** Dibuja un arco. Sintaxis: arc (int x, int y, int ang_comienzo, int ang_final, int radio); (x,y) es el punto central; ang_comienzo y ang_final son los ángulos de comienzo y final en grados; radio es el radio. **bar : ** Dibuja una barra. Sintaxis: bar (int izq, int ar, int der, int ab);

**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">bar3d : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja una barra en 3-D. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: bar3d (int izq, int ar, int der, int ab, int profundidad, int flag_de_encima); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Si flag_de_encima es 0 no se dibuja la cara superior de la barra.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">circle : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja un círculo en (x,y) con el radio dado. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: circle (int x, int y, int radio);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">cleardevice : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Borra la pantalla gráfica. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: cleardevice (void);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">clearviewport : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Borra el viewport corriente. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: clearviewport (void);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">closegraph : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Cierra el sistema gráfico. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: closegraph (void);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">detectgraph : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Determina el controlador y el modo gráfico a usar chequeando el hardware. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: detectgraph (int far *graphdriver, int far *graphmode);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">drawpoly : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja un polígono. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: drawpoly (int numero_de_puntos, int far <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">*puntos_de_poligono); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">*puntos_de_poligono apunta a numero_de_puntos pares de valores. Cada par <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">da los valores de x e y para un punto del polígono.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">ellipse : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja un arco elíptico. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: ellipse (int x, int y, int ang_comienzo, int ang_final, int radiox, int radioy); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">(x,y) es el punto central; ang_comienzo y ang_final son los ángulos de comienzo y final en grados; radiox y radioy son los radios horizontal y vertical.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">fillellipse : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja y rellena una elipse. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: fillellipse (int x, int y, int radiox, int radioy); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Usa (x,y) como el punto central y rellena el arco usando el patrón de relleno actual; radiox y radioy son los radios horizontal y vertical.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">fillpoly : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Dibuja y rellena un polígono. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: fillpoly(int numpoints, int far *polypoints[]); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">*puntos_de_poligono apunta a numero_de_puntos pares de valores. Cada par da los valores de x e y para un punto del polígono.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">floodfill : **<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> Rellena una región definida. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: floodfill (int x, int y, int color_borde); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">(x,y) es un punto que reside dentro de la región a rellenar.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**EJEMPLOS DE ALGUNAS LIBRERIAS PARA GRAFICAR<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;"> (GRAFHISCS.H) **

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 24px; text-align: start; text-decoration: none; vertical-align: baseline;">ARCO ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">void arc(int x, int y, int stangle, int endangle, int radius);

<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">arco dibuja un arco circular en el color de dibujo actual centrada en (x, y) con un radio determinado por radio. Los viajes de arco de Stangle a endangle. Si Stangle es igual a 0 y endangle es igual a 360, la llamada al arco dibuja un círculo completo. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">El ángulo de arco se calcula la izquierda, con 0 grados a las 3 horas, 90 grados a las 12en punto, y así sucesivamente. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">El parámetro linestyle no afecta a los arcos, círculos, elipses, o rebanadas de pastel. Sólo el espesor parámetro se utiliza. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Si estás utilizando un CGA en el modo de alta resolución o un adaptador de gráficos monocromáticos, el ejemplos en la Ayuda en línea que muestran cómo utilizar las funciones de gráficos no podría producir el los resultados esperados. Si el sistema funciona con un adaptador CGA o blanco y negro, pasar el valor 1 a las funciones que alteran el color de relleno o de dibujo (setcolor, setfillstyle y setlinestyle, por ejemplo), en lugar de un color constante simbólica (definido en graphics.h).

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Ejemplo de Arco ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* arc example */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdlib.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <conio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int main(void) <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">{ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* request autodetection */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int gdriver = DETECT, gmode, errorcode; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int midx, midy; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int stangle = 45, endangle = 135; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int radius = 100; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* initialize graphics and local variables */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">initgraph(&gdriver, &gmode, ""); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* read result of initialization */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">errorcode = graphresult; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">if (errorcode != grOk) { /* an error occurred */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Graphics error: %s\n", grapherrormsg(errorcode)); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Press any key to halt:"); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">exit(1); /* terminate with an error code */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">} <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midx = getmaxx / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midy = getmaxy / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">setcolor(getmaxcolor); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* draw arc */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">arc(midx, midy, stangle, endangle, radius); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* clean up */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">closegraph; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">return 0; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">} <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 24px; text-align: start; text-decoration: none; vertical-align: baseline;">Bar ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis: ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">void bar(int left, int top, int right, int bottom);

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">dibuja una <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">barra delleno <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">- <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">en, <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">barrarectangular <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">, <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">de dosdimensiones <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Labarrasellenaconelactualrelleno <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">modeloyel color de relleno <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">barrano se ofreceel bar <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">, <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">paradibujarunabarrase indicaen dos dimensiones <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">, <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">usobar3dconla profundidadigual a 0 <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">La parte superior izquierdae inferiorderechadelrectánguloestán dados por( <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">arriba a la izquierda), <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">y(a la derecha <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">, <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">abajo <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">), <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">respectivamente <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Lascoordenadasse refierena lospíxeles

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Valor de Retorno ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Ninguno <span class="shorttext" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Véase ****<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">también ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">bar3d <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">rectangle <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">setcolor <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">setfillstyle <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">setlinestyle <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Ejemplo <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* bar example */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdlib.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <conio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int main(void) <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">{ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* request autodetection */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int gdriver = DETECT, gmode, errorcode; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int midx, midy, i; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* initialize graphics and local variables */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">initgraph(&gdriver, &gmode, ""); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* read result of initialization */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">errorcode = graphresult; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">if (errorcode != grOk) { /* an error occurred */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Graphics error: %s\n", grapherrormsg(errorcode)); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Press any key to halt:"); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">exit(1); /* terminate with an error code */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">} <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midx = getmaxx / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midy = getmaxy / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* loop through the fill patterns */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">for (i=SOLID_FILL; i<USER_FILL; i++) { <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* set the fill style */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">setfillstyle(i, getmaxcolor); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* draw the bar */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">bar(midx-50, midy-50, midx+50, midy+50); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">} <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* clean up */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">closegraph; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">return 0;} <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 24px; text-align: start; text-decoration: none; vertical-align: baseline;">Círculo <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Sintaxis <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">void circle(int x, int y, int radius);

<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Círculo dibuja un círculo en el color de dibujo actual con su centro en (x, y) y teniendo en cuenta el radio <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">por radio. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">El parámetro linestyle no afecta a los arcos, círculos, elipses, o rebanadas de pastel. Sólo el espesor <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">parámetro se utiliza. <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Si los círculos no son perfectamente redondas, modifica la relación de aspecto.

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Valor de Retorno ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Ninguno <span class="shorttext" style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;"><span class="hps" style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Véase ****<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">también ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">arc <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">ellipse <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">fillellipse <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">getaspectratio <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">sector <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">setaspectratio <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">Ejemplo ** <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* circle example */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <graphics.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdlib.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <stdio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">#include <conio.h> <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int main(void) <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">{ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* request autodetection */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int gdriver = DETECT, gmode, errorcode; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">int midx, midy, radius = 100; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* initialize graphics and local variables */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">initgraph(&gdriver, &gmode, ""); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* read result of initialization */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">errorcode = graphresult; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">if (errorcode != grOk) { /* an error occurred */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Graphics error: %s\n", grapherrormsg(errorcode)); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">printf("Press any key to halt:"); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">exit(1); /* terminate with an error code */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">} <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midx = getmaxx / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">midy = getmaxy / 2; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">setcolor(getmaxcolor); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* draw the circle */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">circle(midx, midy, radius); <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">/* clean up */ <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">getch; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">closegraph; <span style="background-color: transparent; color: #000000; font-family: 'Arial','sans-serif'; font-size: 13.3333px; text-align: start; text-decoration: none; vertical-align: baseline;">return 0;}

<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">**PEQUEÑO TUTORIAL DE COMO USAR GRAPHICS.H** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-align: start; text-decoration: none; vertical-align: baseline;">http://www.youtube.com/watch?v=OUKDLlpBb5o&feature=related