1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 | #include <conio.h>
#include <stdio.h>
#include <dos.h>
#include <graphics.h>
void menu(void);
int colormarco();
void imprimir(int x,int y,int ancho, int alto, int colormarco, int fondo);
void titulo(int x,int y,int colormarco);
int x,y,ancho,alto;
main(){
int i,lColor,lTexto,lFondo;
char nombre[80];
clrscr();
textcolor(15); menu();
gotoxy(2,10);
printf("Nombre: ");
scanf("%s",&nombre);
clrscr();
printf("Color del marco");
lColor=colormarco();
clrscr();
printf("Color del titulo"); lTexto=colormarco();
clrscr();
printf("Color del fondo");
lFondo=colormarco();
imprimir(x,y,ancho,alto,lColor,lFondo);
textcolor(lTexto);
gotoxy(x+2,y); cprintf("[%s]",nombre);
getch();
getch();
return(0);
}
void menu(void)
{
gotoxy(2,2);
printf("Dame la coordenada X,Y"); gotoxy(2,3);
printf("X: ");
scanf("%d",&x);
gotoxy(2,4);
printf("Y: "); scanf("%d",&y);
gotoxy(2,6);
printf("Tama¤o ancho y alto");
gotoxy(2,7);
printf("Ancho: "); scanf("%d",&ancho);
gotoxy(2,8);
printf("Alto: ");
scanf("%d",&alto);
}
int colormarco()
{
int color;
textcolor(15);gotoxy(5,4);cprintf("Color Opcion");textcolor(15);gotoxy(5,5);cprintf("==================");
textcolor(1);gotoxy(5,6);cprintf("Azul 1");
textcolor(2);gotoxy(5,7);cprintf("Verde 2");
textcolor(4);gotoxy(5,8);cprintf("Rojo 4");
textcolor(6);gotoxy(5,9);cprintf("Cafe 6");textcolor(9);gotoxy(5,10);cprintf("Azul Cielo 9");
textcolor(14);gotoxy(5,11);cprintf("Amarillo 14");
textcolor(15);gotoxy(5,12);cprintf("Blanco 15");
textcolor(15);gotoxy(2,13);cprintf("Opcion: ");
cscanf("%d",&color); return(color);
}
void imprimir(int x,int y,int ancho, int alto, int colormarco, int fondo)
{ int i,j;
clrscr();
textcolor(colormarco);
gotoxy(x,y);
cprintf("%c",201);//É gotoxy(x,alto);
cprintf("%c",200);//�
for (i=x+1;i<alto;j++)
{ textcolor(fondo);
gotoxy(i,j);
cprintf("%c",219);//Û
}
textcolor(colormarco); gotoxy(i,y);
cprintf("%c",205);//�
gotoxy(i,alto);
cprintf("%c",205);//�
} for (i=y+1;i<alto;i++)
{
gotoxy(x,i);
cprintf("%c",186);//º
gotoxy(ancho,i); cprintf("%c",186);//º
}
gotoxy(ancho,y);
cprintf("%c",187);//» gotoxy(ancho,alto);
cprintf("%c",188);//¼
} |