AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Wie funktioniert TColorKeyAnimation?

Ein Thema von Peter-Pascal · begonnen am 3. Mär 2025 · letzter Beitrag vom 11. Mär 2025
Antwort Antwort
Peter-Pascal

Registriert seit: 18. Feb 2007
Ort: 32139 Spenge
200 Beiträge
 
Delphi 11 Alexandria
 
#1

Wie funktioniert TColorKeyAnimation?

  Alt 3. Mär 2025, 16:53
Hallo,
es gibt zwei Key-Animationen bei Delphi.FMX ColorKey- und FloatKeyAnimation und beide bekomme ich nicht zum Laufen. Was mache ich falsch?
Im Anhang die ScreenShots meiner Einstellungen.
Vielen Dank.
Gruß Peter
Miniaturansicht angehängter Grafiken
colorkeys.png   colorkeyanimation1.png  
Peter Niemeier
  Mit Zitat antworten Zitat
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.845 Beiträge
 
Delphi 12 Athens
 
#2

AW: Wie funktioniert TColorKeyAnimation?

  Alt Heute, 01:58
Über Key setzt du Werte in Keys auf einen Zeitstrahl von 0.0 (Start) bis 1.0 (Ende). Duration gibt die gesamte Länge der Animation an. Hier ein Beispiel. Ich habe das mal in FormCreate gepackt und das TRectangle dynamisch erstellt, so dass es einfach so gehen sollte:
Delphi-Quellcode:
uses
  FMX.Ani, FMX.Objects;

procedure TForm286.FormCreate(Sender: TObject);
var
  Rectangle: TRectangle;
  ColorKeyAnimation1: TColorKeyAnimation;
  ColorKey1, ColorKey2, ColorKey3, ColorKey4: TColorKey;
begin
  Rectangle := TRectangle.Create(Self);
  Rectangle.Parent := Self;
  Rectangle.Width := 200;
  Rectangle.Height := 100;
  Rectangle.Position.X := 100;
  Rectangle.Position.Y := 100;
  Rectangle.Fill.Color := TAlphaColorRec.Red;

  ColorKeyAnimation1 := TColorKeyAnimation.Create(Self);
  ColorKeyAnimation1.Parent := Rectangle;
  ColorKeyAnimation1.PropertyName := 'Fill.Color';
  ColorKeyAnimation1.Duration := 3.0;
  ColorKeyAnimation1.Loop := True;

  ColorKey1 := ColorKeyAnimation1.Keys.Add as TColorKey;
  ColorKey1.Key := 0.0;
  ColorKey1.Value := TAlphaColorRec.Red;

  ColorKey2 := ColorKeyAnimation1.Keys.Add as TColorKey;
  ColorKey2.Key := 0.33;
  ColorKey2.Value := TAlphaColorRec.Green;

  ColorKey3 := ColorKeyAnimation1.Keys.Add as TColorKey;
  ColorKey3.Key := 0.67;
  ColorKey3.Value := TAlphaColorRec.Blue;

  ColorKey4 := ColorKeyAnimation1.Keys.Add as TColorKey;
  ColorKey4.Key := 1.0;
  ColorKey4.Value := TAlphaColorRec.Red;

  ColorKeyAnimation1.Start;
end;
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:55 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz