Pascal/Turbo Pascal - Imagen de fondo en PASCAL?

 
Vista:

Imagen de fondo en PASCAL?

Publicado por Cristian Fernando (2 intervenciones) el 01/11/2011 16:00:57
Bueno, mi pregunta es sensilla, supongamos que tengamos un programa simple hecho en pascal por ejemplo uno que cargue un vector y luego lo imprima.. (Solo por dar una ejemplo) se le puede a este agregar una imagen de fondo? y si la respuesta es SI, ¿como lo hago? bueno ojala puedan aclarar mi duda, muchas gracias! :)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Imagen de fondo en PASCAL?

Publicado por ramon (2158 intervenciones) el 01/11/2011 19:19:05
{Esto seria un pequeño truco para un fondo rápido mira como se desplaza el texto que
escribas por encima del fondo.
Aunque se pueden emplear técnicas mas curiosas por ejemplo paginado de pantalla
en modo texto y otras en modo gráfico a ver si esto te sirve.

program fondo;
uses
crt;
var
matri : array[1..20] of char;
x, y, d, tex : integer;
tecla : char;

procedure matri_fondo;
var
i, u : integer;
begin
for i := 1 to 40 do
for u := 1 to 12 do
begin
gotoxy(i * 2,u * 2);write('.');
end;
end;

procedure texto;
var
tec : char;
cont : integer;
begin
cont := 1;
gotoxy(1,11);write('Entre Texto 20 Letras : ');
repeat
tec := readkey;
if tec in[#48..#126,#164,#165,#32] then
begin
matri[cont] := tec;
gotoxy(24 + cont,11);write(matri[cont]);
cont := cont + 1;
if cont > 20 then
cont := 20;
end;
if tec = #8 then
begin
cont := cont - 1;
if cont < 1 then
cont := 1;
matri[cont] := ' ';
gotoxy(24 + cont,11);write(' ');
end;
until tec = #13;
tex := cont - 1;
gotoxy(1,11);clreol;
end;


begin
clrscr;
texto;
x := 1;
y := 1;
matri_fondo;
for d := 1 to tex do
begin
gotoxy(x + d,y);write(matri[d]);
end;
repeat
tecla := readkey;
if tecla = #72 then
begin
y := y - 1;
if y < 1 then
y := 1;
end;
if tecla = #80 then
begin
y := y + 1;
if y > 24 then
y := 24;
end;
if tecla = #75 then
begin
x := x - 1;
if x < 1 then
x := 1;
end;
if tecla = #77 then
begin
x := x + 1;
if x > (79 - tex) then
x := (79 - tex);
end;
clrscr;
matri_fondo;
for d := 1 to tex do
begin
gotoxy(x + d,y);write(matri[d]);
end;
until tecla = #13;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Imagen de fondo en PASCAL?

Publicado por M2 (15 intervenciones) el 18/12/2012 16:35:48
Hola he visto que comentas lo del paginado en pascal, no lo entiendo muy bien y necesito utilizarlo para mostrar los datos de registros me podrias poner algun otro ejemplo, ademas no nos dejan utilizar las sentencias gotoxy, muchas gracias de todas formas.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Imagen de fondo en PASCAL?

Publicado por ramon (2158 intervenciones) el 18/12/2012 22:00:40
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
{A qui tienes 4 paginas de pantalla en texto de la 0 a la 3 como podrás ver cambio el  texto de posición}
 
 
 program pantallas;
 uses
   crt, dos;
  type
     pantalla = array[1..25,1..80] of integer;
 
  var
    lineas : array[0..3] of ^pantalla;
    reg : registers;
 
  procedure moverpagina(maxp : byte);
  var
     n, i, d : byte;
     cad : string;
     tec : char;
   begin
          cad := 'Estamos En Pagina N0    '^M^J;  {Pajina N 0}
          lineas[0] := ptr($b800,0 * $1000);
          cad[23] := char($30 + n);
          for d := 1 to 22 do
          lineas[0]^[2,20 + d] := 256 * (n + 8) + byte(cad[d]);   {colocación en pantalla y = 2  x = 20 + d}
 
          cad := 'Estamos En Pagina N1    '^M^J; {Pajina N 1}
          lineas[0] := ptr($b800,1 * $1000);
          cad[23] := char($30 + n);
          for d := 1 to 22 do
          lineas[0]^[4,20 + d] := 256 * (n + 8) + byte(cad[d]);     {colocación en pantalla y = 4  x = 20 + d}
 
          cad := 'Estamos En Pagina N2    '^M^J; {Pajina N 2}
          lineas[0] := ptr($b800,2 * $1000);
          cad[23] := char($30 + n);
          for d := 1 to 22 do
          lineas[0]^[6,20 + d] := 256 * (n + 8) + byte(cad[d]);     {colocación en pantalla y = 6  x = 20 + d}
 
          cad := 'Estamos En Pagina N3    '^M^J; {Pajina N 3}
          lineas[0] := ptr($b800,3 * $1000);
          cad[23] := char($30 + n);
          for d := 1 to 22 do
          lineas[0]^[8,20 + d] := 256 * (n + 8) + byte(cad[d]);  {colocación en pantalla y = 8  x = 20 + d}
 
      repeat
          tec := readkey;
          if tec in['0'..'3'] then
          begin
 
             reg.ax := $0500 + byte(tec) - $30;
             intr($10,reg);
          end;
       until tec = '4';
     end;
 
 
  begin
      clrscr;
      textmode(c80);
      moverpagina(3);
      reg.ax := $0500;
      intr($10,reg);
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar