1)Среда - Delphi 10.2, ОС - Windows и Android от 4.2.2 (сейчас под винду).
2)Кривенький код:
//заполнение таблицы
procedure TForm1.ZapolnenieSG;
var
i,j:integer;
begin
zoom:=20;
SG.RowCount:=n;
for i := 0 to m-1 do
begin
SG.AddObject(TStringColumn.Create(nil));
SG.ColumnByIndex(i).Width:=zoom;
end;
SG.RowHeight:=zoom;
for i := 0 to m-1 do
for j := 0 to n-1 do
begin
SG.Cells[j,i]:=inttostr(ImMas[i,j]);
end;
end;
//собственно, сама закраска
procedure TForm1.SGDrawColumnCell(Sender: TObject; const Canvas: TCanvas;
const Column: TColumn; const Bounds: TRectF; const Row: Integer;
const Value: TValue; const State: TGridDrawStates);
var
aTextRect: TRectF;
aTextLayout: TTextLayout;
begin
aTextRect := Bounds;
aTextRect.Right := Round(aTextRect.Right) + 1;
aTextRect.Bottom := Round(aTextRect.Bottom) - 1;
Canvas.FillRect(aTextRect, 0, 0, AllCorners, 1);
if value.tostring = '1' then
Canvas.ClearRect(aTextRect, TAlphaColorRec.White)
else Canvas.ClearRect(aTextRect, TAlphaColorRec.Black);
end;