AGB  ·  Datenschutz  ·  Impressum  







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

Firemonkey: Animationen in Frames?

Ein Thema von kaju74 · begonnen am 10. Apr 2015 · letzter Beitrag vom 10. Apr 2015
Antwort Antwort
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

AW: Firemonkey: Animationen in Frames?

  Alt 10. Apr 2015, 09:52
Aha, nächste Erkenntnis:

TCustomForm implementiert 'IRoot', TFrame nicht. Daher funktionieren Komponenten-basierte Animationen nicht in Frames. Na super...

Marc
Ein Frame kann kein Root sein warum sollte ein Frame also dann das Interface IRoot implementieren?
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
kaju74

Registriert seit: 22. Okt 2003
185 Beiträge
 
#2

AW: Firemonkey: Animationen in Frames?

  Alt 10. Apr 2015, 12:25
Interessant - mit TButton geht es. Und nun probiere es mal mit TRectangle und einer ColorKey-Animation. Die geht auf einer Form aber nicht in einem Frame.

Oder geht das bei Dir auch?

LG,
Marc
  Mit Zitat antworten Zitat
kaju74

Registriert seit: 22. Okt 2003
185 Beiträge
 
#3

AW: Firemonkey: Animationen in Frames?

  Alt 10. Apr 2015, 12:32
Also, das scheint irgendwie an der ColorKey-Animation zu liegen. Mit der Color-Animation geht's...

Das Problem scheint hier zu liegen:
Delphi-Quellcode:
procedure TColorKeyAnimation.ProcessAnimation;
var
  T: TRttiType;
  P: TRttiProperty;
  Key1, Key2: TKey;
begin
  if FInstance <> nil then
  begin
    if FKeys.FindKeys(NormalizedTime, Key1, Key2) then
    begin
      if (TFloatKey(Key2).Key - TFloatKey(Key1).Key) = 0 then
        Exit;
      T := SharedContext.GetType(FInstance.ClassInfo);
      if T <> nil then
      begin
        P := T.GetProperty(FPath);
        if (P <> nil) and P.PropertyType.IsOrdinal then
          P.SetValue(FInstance,
            InterpolateColor(TColorKey(Key1).Value, TColorKey(Key2).Value,
              (NormalizedTime - TFloatKey(Key1).Key) / (TFloatKey(Key2).Key - TFloatKey(Key1).Key)));
      end;
    end;
  end;
end;
Die Zeile:

if (TFloatKey(Key2).Key - TFloatKey(Key1).Key) = 0 then verhält sich in einer Form anders als in einem Frame. In einem Frame sind beide Werte = 0, sodaß mit "Exit" aus der Methode gesprungen wird. Bei einer Form nicht. Hier ist der erste Wert = 1 und der zweite = 0.

???

Gruß,
Marc

Geändert von kaju74 (10. Apr 2015 um 12:47 Uhr)
  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 00:40 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-2025 by Thomas Breitkreuz