D
daileking
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Open1Click(Sender: TObject);
var
i,M,q,j,k,r,N : integer;
mask : array [0..7] of integer;
begin
//mask[0..8]:= {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
mask[0] := 0x80;//怎么样对一个数组付初值?
mask[1] := 0x40;
mask[2] := 0x20;
mask[3] := 0x10;
mask[4] := 0x08;
mask[5] := 0x04;
mask[6] := 0x02;
mask[7] := 0x01;
if OpenDialog1.Execute then
begin
fstream1:=TFileStream.Create(pchar(OpenDialog1.FileName),fmOpenReadWrite);
fstream1.Seek(0,soFromBeginning);
fstream1.Read(buf,72);
end;
M:= 1;
N:= 1;
for i:=0 to 24*M do //I的步长是M,怎么实现?
begin
for q := 0 to M do
begin
for j := 0 to 3 do
begin
for k := 0 to 8 do
begin
if (mask[k mod 8] and buf[3*i/M+j]) <> 0 then //这一句不对,怎么改?
begin
for r := 0 to N do
begin
PaintBox1.Canvas.Pixels[i+M , j*N*8+k*N+r] := clRed;
end;
end;
end;
end;
end;
i:=i+M;
end;
end;
var
i,M,q,j,k,r,N : integer;
mask : array [0..7] of integer;
begin
//mask[0..8]:= {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
mask[0] := 0x80;//怎么样对一个数组付初值?
mask[1] := 0x40;
mask[2] := 0x20;
mask[3] := 0x10;
mask[4] := 0x08;
mask[5] := 0x04;
mask[6] := 0x02;
mask[7] := 0x01;
if OpenDialog1.Execute then
begin
fstream1:=TFileStream.Create(pchar(OpenDialog1.FileName),fmOpenReadWrite);
fstream1.Seek(0,soFromBeginning);
fstream1.Read(buf,72);
end;
M:= 1;
N:= 1;
for i:=0 to 24*M do //I的步长是M,怎么实现?
begin
for q := 0 to M do
begin
for j := 0 to 3 do
begin
for k := 0 to 8 do
begin
if (mask[k mod 8] and buf[3*i/M+j]) <> 0 then //这一句不对,怎么改?
begin
for r := 0 to N do
begin
PaintBox1.Canvas.Pixels[i+M , j*N*8+k*N+r] := clRed;
end;
end;
end;
end;
end;
i:=i+M;
end;
end;