娃
娃娃
Unregistered / Unconfirmed
GUEST, unregistred user!
问题过于复杂化了
procedure TForm1.Button1Click(Sender: TObject);
var
i,J: integer;
T,L,R: Integer;
KX: Integer;//空隙
aColor: TColor;
tmpL: TStrings;
s: string;
begin
L:=20;
T:=50;
R:=34;
KX:=6;
tmpL:=TStringList.Create;
for i := 0 to memo1.Lines.Count-1 do
begin
s:=memo1.Lines.Strings;
tmpL.Clear;
tmpL.Text:=StringReplace(s, ' ', #13#10, [rfReplaceAll]);
for j := 0 to tmpL.Count-1 do
with dbGrid1.Canvas do
begin
aColor:=GetBS(tmpL.Strings[J]);
Brush.Color := aColor;
Ellipse(L+R*J+KX*J,T+KX*I+R*I,L+R*J+KX*J+R,T+KX*I+R*I+R);
Font.Color := clWhite;
Font.Style := Font.Style + [fsBold];
Font.Size := 11;
TextOut(L+R*J+KX*J+8, T+KX*I+R*I+8, tmpL.strings[j]);
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,J: integer;
T,L,R: Integer;
KX: Integer;//空隙
aColor: TColor;
tmpL: TStrings;
s: string;
begin
L:=20;
T:=50;
R:=34;
KX:=6;
tmpL:=TStringList.Create;
for i := 0 to memo1.Lines.Count-1 do
begin
s:=memo1.Lines.Strings;
tmpL.Clear;
tmpL.Text:=StringReplace(s, ' ', #13#10, [rfReplaceAll]);
for j := 0 to tmpL.Count-1 do
with dbGrid1.Canvas do
begin
aColor:=GetBS(tmpL.Strings[J]);
Brush.Color := aColor;
Ellipse(L+R*J+KX*J,T+KX*I+R*I,L+R*J+KX*J+R,T+KX*I+R*I+R);
Font.Color := clWhite;
Font.Style := Font.Style + [fsBold];
Font.Size := 11;
TextOut(L+R*J+KX*J+8, T+KX*I+R*I+8, tmpL.strings[j]);
end;
end;
end;