bebin in kode mane kojaa mitooni jaash bedi bayad injaa jash bedam
bayad kaari konam ke bejaye inkeh yek dayereh bekesheh aks raa neshoon bedeh
in kode maneh
procedure TForm1.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var couleur : TMatelem;
mylogo : TGraphic;
begin
// récuper la couleur se trouvant dans la matrice
// à la ligne ARow et colonne Acol
couleur := UMatriceCreuse.getMatElem(mat, ARow, ACol);
// applique cette couleur à la case ARow, ACol de la zone de jeu
if (couleur = Elem_head) or (couleur = Elem_body) or (couleur = Elem_vide) then
begin
with Drawgrid1, Canvas do
begin
if(option.Form2.RadioButton1.Checked=true) then
begin
if (couleur=Elem_body)then
couleur:=Clblack;
end
else
if(option.Form2.RadioButton2.Checked=true) then
begin
if (couleur=Elem_body)then
couleur:=clInactiveCaptionText else
if (couleur=Elem_head)then
couleur:=$008000FF;
end
else
if(option.Form2.RadioButton3.Checked=true) then
begin
if (couleur=Elem_body)then
couleur:=$008000FF else
if (couleur=Elem_head)then
couleur:=Clblack;
end
else
if(option.Form2.RadioButton4.Checked=true) then
begin
if (couleur=Elem_body)then
couleur:=clLime else
if (couleur=Elem_head)then
couleur:=$008000FF;
end
else
if(option.Form2.RadioButton5.Checked=true) then
begin
if (couleur=Elem_body)then
couleur:=clSilver else
if (couleur=Elem_head)then
couleur:=$008000FF;
end ;
Pen.Color := couleur;
Brush.Color := couleur;
//Ellipse(Rect);
MyLogo := TMetafile.Create;
try
MyLogo.LoadFromFile('snake.ico');
RvNDRWriter1.Draw(rect,MyLogo);
finally
MyLogo.Free;
end; { tryf }
//Drawgrid1.Canvas.Rectangle(Rect);
end;
end ;