Hello and Merry Xmas to you too!
I will show you saving of an image to a BMP-file.
This is an image in size 1024x768 with 16 colors from TP7.
procedure bmp1024;
var x,y,w1,w2,w3: word;
col,r,r1,g,g1,b,b1: byte;
c1,c2,c3,c4,c5,c6,c7,c8: string;
f: text;
begin
assign(f,'graf01.bmp');
rewrite(f);
c1:= chr($42) + chr($4d) + chr($36) + chr($0) ;
c1:= c1 + chr($24) + chr($0) + chr($0) + chr($0);
c1:= c1 + chr($0) + chr($0) + chr($36) + chr($0);
c1:= c1 + chr($0) + chr($0) + chr($28) + chr($0) ;
c2:= chr($0) + chr($0) + chr($0) + chr($4) ;
c2:= c2 + chr($0) + chr($0) + chr($0) + chr($3) ;
c2:= c2 + chr($0) + chr($0) + chr($1) + chr($0) ;
c2:= c2 + chr($18) + chr($0) + chr($0) + chr($0) ;
c3:= chr($0) + chr($0) + chr($0) + chr($0) ;
c3:= c3 + chr($24) + chr($0) + chr($12) + chr($0b) ;
c3:= c3 + chr($0) + chr($0) + chr($12) + chr($b) ;
c3:= c3 + chr($0) + chr($0) + chr($0) + chr($0) ;
c4:= chr($0) + chr($0) + chr($0) + chr($0) + chr($0) + chr($0) ;
c5:=c1 + c2 + c3 + c4;
write(f,c5);
For y:=0 to MaxY do
begin
For x:=0 to MaxX do
begin
col:=GetPixel(x,y);
case col of
15: begin
r:=0;
g:=0;
b:=0;
end;
10: begin
r:=0;
g:=255;
b:=0;
end;
else begin
r:=255;
g:=255;
b:=255;
end;
end;
write(f,chr(b));
write(f,chr(g));
write(f,chr(r));
end;
end;
close(f);
end;
The start of the BMP is depending of the size of the image. I have been using a program called fileview.exe to read files and find out. Any hexview reader can do it. What image size can you have with TP7? Graphic cards made today are not very good. The best card I have found was Tseng Lab 6000 giving 1280x1024x16 colors