大侠帮忙看看?(50分)

  • 主题发起人 主题发起人 daileking
  • 开始时间 开始时间
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;
 
const
mask : array[0..7] of integer =
($80,$40,$20,$10,$08,$04,$02,$01);

 
for i:=0 to 24*M do //I的步长是M,怎么实现?
循环25次;

步长为M和以步长为1的下列语句不是一样的效果吗?
for i:=0 to 24 do //I的步长是1,
循环25次;
 

for i:=0 to 24*M do //I的步长是M,怎么实现?
begin
for q := 0 to M do


写称:
for I := 0 to 24 do
for q := 0 to M do
已经实现了步长未M

if (mask[k mod 8] and buf[3*i/M+j]) <> 0 then //这一句不对,怎么改?
要循环 9*4*2*25 次是做什么?
PaintBox1.Canvas.Pixels[i+M , j*N*8+k*N+r] := clRed
要循环 9*4*2*25*2 次是做什么?

你究竟要做什么,能描述清楚吗?
 

Similar threads

S
回复
0
查看
685
SUNSTONE的Delphi笔记
S
S
回复
0
查看
645
SUNSTONE的Delphi笔记
S
I
回复
0
查看
686
import
I
后退
顶部