Попытка создать программу, которая может сохранять цвет 0-9 пикселей в текстовый файл.
0 будет прозрачным пикселем.
Как вывести альфа из пикселя и обработатьэто как цвет?
var
x, y, i: integer;
color: TColor;
puffer: array of Byte;
begin
SetLength(puffer, PNGIMG.Width * PNGIMG.Height);
i := 0;
for y := 0 to PNGIMG.Height-1 do begin
for x := 0 to PNGIMG.Width-1 do begin
color := PNGIMG.Canvas.Pixels[x, y];
case color of
//Transparent : puffer[i] := 0;
clNone : puffer[i] := 1;
clBlack : puffer[i] := 1;
clYellow: puffer[i] := 2;
clWhite : puffer[i] := 3;
clRed : puffer[i] := 4;
clBlue : puffer[i] := 5;
clGray : puffer[i] := 6;
clSilver : puffer[i] := 7;
clPurple : puffer[i] := 8;
end;
i := i + 1;
end;
end;
SetLength(Result, Length(puffer));
Move(puffer, Result, SizeOf(puffer));
end;