Programación gráfica C
Buenas. Acabo de empezar en C y me he dado cuenta de que los programas se ejecutan en MS-DOS, me baje y mire varias webs pero no me enteré de mucho. ¿Alguien tiene una pista o sabe como hacerlo? Gracias.
Hola hermano hace poco cree un archivo pdf que te explica paso apaso como hacer graficos en C si tienes in teres te lo podria enviar. este va desde lo mas sencillo hasta lo mas complicado. escribe tu repuesta mi correo.......BYE.
Necesito ese manual de progrmación gráfica cuanto antes no se como hacer que corran imágenes en Borland
si lo que ty quieres es ver como se trabaja en grafica, aqui te envio un programa en borland c++
// program k13_1a.CPP - page 256
// graphics : recurrents squares.
// c++ exercices book - dr. gershon kagan (first edition : 2001)
// written in Borland CPP ver 3.1
// for graphics programs set options windows:
// options -> linker -> libraries -> [x] graphics library
#include <conio.h>
#include <math.h>
#include <dos.h>
#include <graphics.h>
#define N 4
#define K 0.1
void Init()
{
int driver,mode;
detectgraph(&driver,&mode);
initgraph(&driver,&mode,"c:\borlandc\bgi");
} // INIT
void Square(int *p,int level)
{
if(level == 35)
return;
drawpoly(N+1,p);
for(int i = 0; i < 2*N; i++)
{
float d = (p[i+2] - p[i])*K;
p[i] += d;
}
p[2*N] = p[0];
p[2*N+1] = p[1];
Square(p,level+1);
} // SQUARE
void main()
{
int p[2*N+2] = {70,20,550,20,550,460,70,460,70,20};
Init();
setfillstyle(1,BLUE);
fillpoly(N,p);
setcolor(WHITE);
Square(p,0);
getch();
closegraph();
} // MAIN
// program k13_1a.CPP - page 256
// graphics : recurrents squares.
// c++ exercices book - dr. gershon kagan (first edition : 2001)
// written in Borland CPP ver 3.1
// for graphics programs set options windows:
// options -> linker -> libraries -> [x] graphics library
#include <conio.h>
#include <math.h>
#include <dos.h>
#include <graphics.h>
#define N 4
#define K 0.1
void Init()
{
int driver,mode;
detectgraph(&driver,&mode);
initgraph(&driver,&mode,"c:\borlandc\bgi");
} // INIT
void Square(int *p,int level)
{
if(level == 35)
return;
drawpoly(N+1,p);
for(int i = 0; i < 2*N; i++)
{
float d = (p[i+2] - p[i])*K;
p[i] += d;
}
p[2*N] = p[0];
p[2*N+1] = p[1];
Square(p,level+1);
} // SQUARE
void main()
{
int p[2*N+2] = {70,20,550,20,550,460,70,460,70,20};
Init();
setfillstyle(1,BLUE);
fillpoly(N,p);
setcolor(WHITE);
Square(p,0);
getch();
closegraph();
} // MAIN
