本文整理汇总了C#中System.Windows.Media.Animation.ColorAnimation.CreateClock方法的典型用法代码示例。如果您正苦于以下问题:C# ColorAnimation.CreateClock方法的具体用法?C# ColorAnimation.CreateClock怎么用?C# ColorAnimation.CreateClock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Animation.ColorAnimation
的用法示例。
在下文中一共展示了ColorAnimation.CreateClock方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DwellTimeButton
public DwellTimeButton()
{
InitializeComponent();
_isClicked = false;
_buttonList.Add(this);
_timer = new DispatcherTimer();
_timer.Interval = new TimeSpan(0, 0, 0, 0, 10);
_timer.Tick += _timer_Tick;
#region MOUSE EVENTS
_mouseEnterArgs = new MouseEventArgs(Mouse.PrimaryDevice, 0);
_mouseEnterArgs.RoutedEvent = Mouse.MouseEnterEvent;
_mouseLeaveArgs = new MouseEventArgs(Mouse.PrimaryDevice, 0);
_mouseLeaveArgs.RoutedEvent = Mouse.MouseLeaveEvent;
#endregion
#region ANIMATION COLORS
_redBrush = (Color)ColorConverter.ConvertFromString("#fe2712");
_greenBrush = (Color)ColorConverter.ConvertFromString("#ffffff");
#endregion
#region COLOR ANIMATION
_animatedBrush = new SolidColorBrush {Color = _greenBrush};
_enterColorAnimation = new ColorAnimation
{To = _redBrush, Duration = TimeSpan.FromMilliseconds(_DWELL_TIME)};
_enterClock = _enterColorAnimation.CreateClock();
_enterClock.CurrentTimeInvalidated += new EventHandler(EnterClockCurrentTimeInvalidated);
_leavecolorAnimation = new ColorAnimation {Duration = TimeSpan.FromMilliseconds(_DWELL_TIME/2)};
_leaveClock = _leavecolorAnimation.CreateClock();
#endregion
_dwelltime = _DWELL_TIME; //set the value for the dwell time
Background = whiteBackground();
}
示例2: OnReaderDisconnect
public void OnReaderDisconnect(object Capture, string ReaderSerialNumber)
{
this.Dispatcher.Invoke(() =>
{
if (this.ClockHide != null)
this.ClockHide.Controller.Pause();
ColorAnimation animation = new ColorAnimation();
animation.From = (this.UIFinger_Printer.Foreground as SolidColorBrush).Color;
animation.To = Colors.Black;
animation.Duration = new Duration(TimeSpan.FromMilliseconds(450));
animation.EasingFunction = new PowerEase() { Power = 5, EasingMode = EasingMode.EaseInOut };
this.ClockShow = animation.CreateClock();
this.UIFinger_Printer.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockShow);
});
}
示例3: Verify
public void Verify(DPFP.Sample Sample)
{
DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
// Check quality of the sample and start verification if it's good
// TODO: move to a separate task
if (features != null)
{
// Compare the feature set with our template
DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
try
{
Verificator.Verify(features, this.curTemplate , ref result);
if (result.Verified)
{
this.Dispatcher.Invoke(() =>
{
if (this.ClockShow != null)
this.ClockShow.Controller.Pause();
ColorAnimation animation = new ColorAnimation();
animation.From = (this.UIFinger_Printer.Foreground as SolidColorBrush).Color;
animation.To = Colors.Green;
animation.Duration = new Duration(TimeSpan.FromMilliseconds(450));
animation.EasingFunction = new PowerEase() { Power = 5, EasingMode = EasingMode.EaseInOut };
this.ClockHide = animation.CreateClock();
this.UIFinger_Printer.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockHide);
flagFinger = true;
});
this.Stop();
}
else
{
}
}
catch (Exception)
{
}
}
}
示例4: Verify
public void Verify(DPFP.Sample Sample)
{
DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
// Check quality of the sample and start verification if it's good
// TODO: move to a separate task
if (features != null)
{
// Compare the feature set with our template
DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
Verificator.Verify(features, Template, ref result);
if (result.Verified)
{
this.Dispatcher.Invoke(() =>
{
if (this.ClockShow != null)
this.ClockShow.Controller.Pause();
ColorAnimation animation = new ColorAnimation();
animation.From = (this.UIFinger_Printer.Foreground as SolidColorBrush).Color;
animation.To = Colors.Green;
animation.Duration = new Duration(TimeSpan.FromMilliseconds(450));
animation.EasingFunction = new PowerEase() { Power = 5, EasingMode = EasingMode.EaseInOut };
animation.Completed += (s,e) =>
{
App.curUser = UserData.Info(this.cacheName);
App.curUserID = App.curUser.ID;
if (this.UIAutoLogin.IsChecked.Value)
{
App.cache.hashUserName = App.getHash(App.curUserID);
App.cache.userName = Encrypt.EncryptString(this.UITxtName.Text.Trim(), FunctionStatics.getCPUID());
AltaCache.Write(App.CacheName, App.cache);
}
else
{
App.cache.userName = string.Empty;
App.cache.hashUserName = string.Empty;
}
this.UIFullName.Text = App.curUser.Full_Name;
this.UILoginFinger.Animation_Translate_Frame(double.NaN, double.NaN, 400, double.NaN, 500);
this.UILoginSusscess.Animation_Translate_Frame(-400, double.NaN, 0, double.NaN, 500, () => { LoadData(); });
};
this.ClockHide = animation.CreateClock();
this.UIFinger_Printer.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockHide);
this.UIFinger_Status.Text = string.Empty;
});
this.Stop();
}
else
{
this.Dispatcher.Invoke(() =>
{
this.UIFinger_Status.Text = "Try again ...";
});
}
}
}
示例5: Parse
private void Parse(DPFP.Sample Sample)
{
//MessageBox.Show("OK");
DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);
// Check quality of the sample and add to enroller if it's good
if (features != null) try
{
try
{
Enroller.AddFeatures(features); // Add feature set to template.
}
catch
{
}
}
finally
{
UpdateStatus();
// Check if template has been created.
switch (Enroller.TemplateStatus)
{
case DPFP.Processing.Enrollment.Status.Ready: // report success and stop capturing
Stop();
this.Dispatcher.Invoke(() =>
{
if (this.ClockHide != null)
this.ClockHide.Controller.Pause();
ColorAnimation animation = new ColorAnimation();
animation.From = (this.UIStatus.Foreground as SolidColorBrush).Color;
animation.To = Colors.Red;
animation.Duration = new Duration(TimeSpan.FromMilliseconds(450));
animation.EasingFunction = new PowerEase() { Power = 5, EasingMode = EasingMode.EaseInOut };
this.ClockShow = animation.CreateClock();
this.UIStatus.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockShow);
});
if (OnTemplateEvent != null)
{
OnTemplateEvent(this, Enroller.Template);
}
break;
case DPFP.Processing.Enrollment.Status.Failed: // report failure and restart capturing
Enroller.Clear();
Stop();
this.Dispatcher.Invoke(() =>
{
this.UITime.Text = "Try again ...";
this.UITime.FontSize = 15.333;
this.UITime.FontWeight = FontWeights.Normal;
this.UITime.Foreground = new SolidColorBrush(Colors.White);
});
Start();
break;
}
}
}
示例6: OnReaderConnect
public void OnReaderConnect(object Capture, string ReaderSerialNumber)
{
this.Dispatcher.Invoke(() =>
{
ColorAnimation animation = new ColorAnimation();
animation.From = (this.UIStatus.Foreground as SolidColorBrush).Color;
animation.To = Colors.Blue;
animation.Duration = new Duration(TimeSpan.FromMilliseconds(450));
animation.EasingFunction = new PowerEase() { Power = 5, EasingMode = EasingMode.EaseInOut };
this.ClockHide = animation.CreateClock();
this.UIStatus.Foreground.ApplyAnimationClock(SolidColorBrush.ColorProperty, ClockHide);
});
}