当前位置: 首页>>代码示例>>C#>>正文


C# ColorAnimation.CreateClock方法代码示例

本文整理汇总了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();
        }
开发者ID:Bomadeno,项目名称:ETU_EightPuzzle,代码行数:42,代码来源:DwellTimeButton.xaml.cs

示例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);
     });
 }
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:15,代码来源:UIUserEdit.xaml.cs

示例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)
                {
                  
                }
            }
        }
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:42,代码来源:UIUserEdit.xaml.cs

示例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 ...";
                    });
                }
            }
        }
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:56,代码来源:UILogin.xaml.cs

示例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;

                    }
                }
        }
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:61,代码来源:FingerPrinter.xaml.cs

示例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);
     });
 }
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:13,代码来源:FingerPrinter.xaml.cs


注:本文中的System.Windows.Media.Animation.ColorAnimation.CreateClock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。