View Single Post
  #372  
Old 25-09-2023, 14:37
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
Quote:
Originally Posted by audiofeel View Post
@BLACKFIRE69
Show an example of how to change the color of objects on the fly, as in the example below? FReactangle(FillColor.Stroke.Color). I can't do it with FColorbox.I can't do it. The color changes if you only touch the object.
Code:
var
  UIColour: array of TAlphaColor = [$B93A4955, $FF202B2F, $FFC0233C];
procedure TForm1.ComboColorBox1Change(Sender: TObject);
var
  I, J: Integer;
begin
  if ComboColorBox1 = Sender then
    J := 0;
  if ComboColorBox2 = Sender then
    J := 1;
  if ComboColorBox3 = Sender then
    J := 2;
  for I := 0 to ComponentCount - 1 do
  begin
    if (Components[I] is TShape) then
    begin
      if TShape(Components[I]).TagString = J.ToString then
        TShape(Components[I]).Fill.Color := TComboColorBox(Sender).Color;
      if TShape(Components[I]).TagString = (J + Length(UIColour)).ToString then
        TShape(Components[I]).Stroke.Color := TComboColorBox(Sender).Color;
    end;
    UIColour[J] := TComboColorBox(Sender).Color;
  end;
end;
see this, change the color of objects on the fly.
Code:
FMXColorAnimation[1].StopAtCurrent;
FMXColorAnimation[1].SetColors(FMXComboColorBox[2].GetColor, FMXComboColorBox[1].GetColor);
FMXColorAnimation[1].Start;
Code:
FMXArc[2].StrokeColor(FMXComboColorBox[3].GetColor);
FMXCircle[5].StrokeColor(FMXComboColorBox[3].GetColor);
FMXRectangle[87].FillColor(FMXComboColorBox[3].GetColor);
Attached Images
File Type: png Screenshot 2023-09-25 223350.png (432.1 KB, 94 views)
Attached Files
File Type: 7z Thanks Gift 2024.7z (4.03 MB, 7 views)

Last edited by hitman797; 25-09-2023 at 14:45.
Reply With Quote
The Following User Says Thank You to hitman797 For This Useful Post:
audiofeel (25-09-2023)