bmp := TBitMap.Create;
bmp.Height := pic_h;
bmp.Width := pic_w;
bmp.PixelFormat := pf24bit;
for j:= 0 to bmp.Height-1 do
begin
PRGB := bmp.ScanLine[j];
for i:= 0 to bmp.Width-1 do
begin
PRGB^.rgbtRed := data[j];
PRGB^.rgbtGreen := data[j];
PRGB^.rgbtBlue := data[j];
Inc(PRGB);
end;
end;
Bitblt(Image1.Canvas.Handle, 0, 0, pic_w, pic_h, bmp.Canvas.Handle, 0, 0, SRCCOPY);
Image1.Refresh;
bmp.Free;
显示灰度图象。