Ok I understand now. Using the link provided by Avatar I think I found Exactly what your looking for. This will use scanlines so it may end up being a bit faster.
Code:
procedure DrawImage;
var
X, Y: Integer;
Bmp: TBitMap;
Row: pByteArray;
begin
Bmp := TBitMap.Create;
Bmp.Width := 60;
Bmp.Height := 120;
Bmp.PixelFormat := pf8bit;
for X := 0 to Bmp.Height - 1 do
begin
Row := Bmp.ScanLine[X];
For Y := 0 to Bmp.Width - 1 do
begin
Row[Y] := {Your Color index value};
end;
end;
end;
This will use the default palette. If you want to change any of the colors in the palette look at the delphi help for TBitmap.palette. It has a good example there. Also sorry if I reversed the width and height. I was not as concerned with that as I was the example.
-Jeremy
Bookmarks