public Table(EmployeewsOfLocalPOS unitofwork, EmployeewsOfCloudPOS cloudPosUnitofwork)
        {
            _unitofwork         = unitofwork;
            _cloudPosUnitofwork = cloudPosUnitofwork;
            InitializeComponent();

            recShadow = new DropShadowBitmapEffect
            {
                Color = new Color {
                    A = 1, R = 255, G = 0, B = 0
                },
                ShadowDepth = 5,
                Direction   = 270,
                Softness    = 0.60,
                Opacity     = 0.75
            };

            recShadowOrdered = new DropShadowBitmapEffect
            {
                Color = new Color {
                    A = 1, R = 0, G = 55, B = 55
                },
                ShadowDepth = 5,
                Direction   = 270,
                Softness    = 0.60,
                Opacity     = 0.75
            };

            initTableData();

            Loaded += TablePage_loaded;
        }
예제 #2
0
        public void StartDrag()
        {
            //Break Canvas bindings
            SetContainerCanvasBindings(SetBindingMode.ClearBinding);

            //Create DropShadow
            DropShadowBitmapEffect dps = new DropShadowBitmapEffect();

            dps.SetValue(NameProperty, "dps");
            dps.Softness    = 1;
            dps.ShadowDepth = 0;
            this.sContainer.BitmapEffect = dps;
            this.sContainer.RegisterName(dps.GetValue(NameProperty).ToString(), dps);

            //Resize Window
            this.Height += 10;
            this.Width  += 10;

            //Create animation
            DoubleAnimation animShowDropShadow = new DoubleAnimation(0, 5, TimeSpan.FromMilliseconds(100));

            Storyboard.SetTargetName(animShowDropShadow, dps.GetValue(NameProperty).ToString());
            Storyboard.SetTargetProperty(animShowDropShadow, new PropertyPath(DropShadowBitmapEffect.ShadowDepthProperty));
            Storyboard storyShowDrop = new Storyboard();

            storyShowDrop.Children.Add(animShowDropShadow);
            storyShowDrop.Begin(this.sContainer);

            this.DragMove();
        }
예제 #3
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     btnleft_Content  = null;
     btnright_Content = null;
     ShadowEffect     = null;
     //GC.Collect();
 }
예제 #4
0
 public void selectedBitmapEffect()
 {
     BitmapEffect = new DropShadowBitmapEffect()
     {
         ShadowDepth = 5, Color = Colors.Black
     };
 }
        // Add Blur effect.
        void OnClickDropShadowButton(object sender, RoutedEventArgs args)
        {
            // Get a reference to the Button.
            Button myButton = (Button)sender;

            // Initialize a new DropShadowBitmapEffect that will be applied
            // to the Button.
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            Color myShadowColor = new Color();

            myShadowColor.ScA        = 1; // Note that the alpha value is ignored by Color property. The Opacity property is used to control the alpha.
            myShadowColor.ScB        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScR        = 0;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 320;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 25;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 1;

            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 0.5;

            // Apply the bitmap effect to the Button.
            myButton.BitmapEffect = myDropShadowEffect;
        }
예제 #6
0
 public void errorBitmapEffect()
 {
     BitmapEffect = new DropShadowBitmapEffect()
     {
         ShadowDepth = 10, Color = Colors.Red
     };
 }
예제 #7
0
        public void defaultBitmapEffect()
        {
            // http://stackoverflow.com/questions/4022746/wpf-add-a-dropshadow-effect-to-an-element-from-code-behind
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();
            // Set the color of the shadow to Black.
            Color myShadowColor = new Color();

            myShadowColor.ScA        = 1;
            myShadowColor.ScB        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScR        = 0;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 320;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 10;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 0.5;
            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 0.5;

            BitmapEffect = myDropShadowEffect;
        }
        /// <summary>
        /// Wins the activated.
        /// </summary>
        private void WinActivated()
        {
            object obj;
            object convertFromString;

            try
            {
                obj = (ColorConverter.ConvertFromString("#0070C5"));
                if (obj != null)
                {
                    // BorderBrush = new SolidColorBrush((Color)obj);

                    ShadowEffect = new DropShadowBitmapEffect();
                }
                ShadowEffect.ShadowDepth = 0;
                ShadowEffect.Opacity     = 0.5;
                ShadowEffect.Softness    = 0.5;
                //convertFromString = ColorConverter.ConvertFromString("#003660");
                // if (convertFromString != null)
                // ShadowEffect.Color = (Color)convertFromString;
            }
            catch (Exception ex)
            {
                logger.Error("MessageBoxViewModel : WinActivated : " + ex.Message);
            }
            finally
            {
                obj = null;
                convertFromString = null;
                GC.Collect();
            }
        }
예제 #9
0
        public MultipleEffectExample()
        {
            Button myButton = new Button();

            myButton.Content = "DropShadow under this Button";
            myButton.Margin  = new Thickness(50);
            myButton.Width   = 300;

            // Create the BitmapEffects to apply to the button.
            BlurBitmapEffect myBlurBitmapEffect = new BlurBitmapEffect();

            myBlurBitmapEffect.Radius = 2;

            DropShadowBitmapEffect myDropShadowBitmapEffect = new DropShadowBitmapEffect();

            myDropShadowBitmapEffect.Color       = Colors.Black;
            myDropShadowBitmapEffect.Direction   = 320;
            myDropShadowBitmapEffect.ShadowDepth = 30;
            myDropShadowBitmapEffect.Softness    = 1;
            myDropShadowBitmapEffect.Opacity     = 0.5;

            BitmapEffectGroup myBitmapEffectGroup = new BitmapEffectGroup();

            myBitmapEffectGroup.Children.Add(myBlurBitmapEffect);
            myBitmapEffectGroup.Children.Add(myDropShadowBitmapEffect);

            myButton.BitmapEffect = myBitmapEffectGroup;

            StackPanel myStackPanel = new StackPanel();

            myStackPanel.Children.Add(myButton);
            this.Content = myStackPanel;
        }
        public void OffDropShadow()
        {
            // Get a reference to the Button.
            CxComboBox ComboBox = this;

            // Initialize a new DropShadowBitmapEffect that will be applied
            // to the Button.
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            Color myShadowColor = new Color();

            myShadowColor.ScA        = 1; // Note that the alpha value is ignored by Color property. The Opacity property is used to control the alpha.
            myShadowColor.ScB        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScR        = 0;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 0;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 0;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 0;

            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 0;

            // Apply the bitmap effect to the Button.
            ComboBox.BitmapEffect = myDropShadowEffect;
        }
예제 #11
0
 private void GlowVertices(bool light)
 {
     if (light)
     {
         var readyToSelectEffect = new DropShadowBitmapEffect
         {
             Color       = Colors.Blue,
             Direction   = 320,
             ShadowDepth = 0,
             Softness    = 1,
             Opacity     = 1
         };
         foreach (var btnVertex in GridGraph.Children.OfType <Button>())
         {
             btnVertex.BitmapEffect = readyToSelectEffect;
             btnVertex.BorderBrush  = new SolidColorBrush(Color.FromRgb(155, 144, 239));
             Extensions.VertexState(btnVertex, (int)VertexState.ReadyForGreedyColoring);
         }
         IsOnGreedyColoringState           = true;
         GridGreedyColoringInfo.Visibility = Visibility.Visible;
     }
     else
     {
         foreach (var btnVertex in GridGraph.Children.OfType <Button>())
         {
             btnVertex.BitmapEffect = null;
             Extensions.VertexState(btnVertex, (int)VertexState.Normal);
         }
         GridGreedyColoringInfo.Visibility = Visibility.Hidden;
         IsOnGreedyColoringState           = false;
         _queuebButtons.Clear();
     }
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     btnleft_Content  = null;
     btnright_Content = null;
     ShadowEffect     = null;
     //GC.Collect();
     GC.SuppressFinalize(this);
 }
예제 #13
0
        /// <summary>
        /// This summary has not been prepared yet. NOSUMMARY - pantal07
        /// </summary>
        public static BitmapEffect DropShadow(Color color, double direction, double depth)
        {
            DropShadowBitmapEffect effect = new DropShadowBitmapEffect();

            effect.Color       = color;
            effect.Direction   = direction;
            effect.ShadowDepth = depth;
            effect.Softness    = 0.0;

            return(effect);
        }
예제 #14
0
        private void Label_MouseEnter_1(object sender, System.Windows.Input.MouseEventArgs e)
        {
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            myDropShadowEffect.Color       = (Color)ColorConverter.ConvertFromString("#FFC89F48");
            myDropShadowEffect.Direction   = 0;
            myDropShadowEffect.ShadowDepth = 2;
            myDropShadowEffect.Softness    = 5;

            myDropShadowEffect.Opacity = 0.5;
            AboutLBL.BitmapEffect      = myDropShadowEffect;
        }
예제 #15
0
        public static DropShadowBitmapEffect getShadowEffect()
        {
            DropShadowBitmapEffect shadowEffect = new DropShadowBitmapEffect();

            System.Windows.Media.Color myShadowColor = new System.Windows.Media.Color();
            myShadowColor.ScA        = 1;
            myShadowColor.ScR        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScB        = 0;
            shadowEffect.Color       = myShadowColor;
            shadowEffect.Direction   = 320;
            shadowEffect.ShadowDepth = 10;
            shadowEffect.Softness    = 1;
            shadowEffect.Opacity     = 0.3;
            return(shadowEffect);
        }
예제 #16
0
        public void AddDropShadowEffect(Image img, double Depth, double Softness, double Opacity)
        {
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();
            Color myShadowColor = new Color();

            myShadowColor.ScA              = 1;
            myShadowColor.ScB              = 0;
            myShadowColor.ScG              = 0;
            myShadowColor.ScR              = 0;
            myDropShadowEffect.Color       = myShadowColor;
            myDropShadowEffect.Direction   = 320;
            myDropShadowEffect.ShadowDepth = Depth;
            myDropShadowEffect.Softness    = Softness;
            myDropShadowEffect.Opacity     = Opacity;
            img.BitmapEffect = myDropShadowEffect;
        }
예제 #17
0
        private void MouseEnter(object sender, MouseEventArgs e)
        {
            Image myButton = sender as Image;
            DropShadowBitmapEffect mydrop = new DropShadowBitmapEffect();
            Color color = new Color();

            color.ScR             = 0;
            color.ScG             = 0;
            color.ScB             = 0;
            mydrop.Color          = color;
            mydrop.Direction      = 200;
            mydrop.ShadowDepth    = 20;
            mydrop.Softness       = 10;
            mydrop.Opacity        = 1;
            myButton.BitmapEffect = mydrop;
        }
예제 #18
0
        public UserLevelStatisticsConfigViewModel()
        {
            try
            {
                logger.Debug("UserLevelStatisticsConfigViewModel : Constructor - Entry");
                ObjectCollection = new ObservableCollection <ObjectValues>();

                TabValues = new ObservableCollection <TabItem>();

                Dictionary <StatisticsEnum.ThemeColors, SolidColorBrush> dictTheme = new Dictionary <StatisticsEnum.ThemeColors, SolidColorBrush>();
                dictTheme = objStatSupport.ThemeSelector(Settings.GetInstance().Theme);

                TitleBackground    = dictTheme[StatisticsEnum.ThemeColors.TitleBackground];
                BackgroundColor    = dictTheme[StatisticsEnum.ThemeColors.BackgroundColor];
                TitleForeground    = dictTheme[StatisticsEnum.ThemeColors.TitleForeground];
                BorderBrush        = dictTheme[StatisticsEnum.ThemeColors.BorderBrush];
                ShadowEffect       = new DropShadowBitmapEffect();
                ShadowEffect.Color = (Color)BorderBrush.Color;

                foreach (Window currentwindow in System.Windows.Application.Current.Windows)
                {
                    if (currentwindow.Title == "ObjectConfigurations")
                    {
                        currentwindow.Close();
                    }
                }

                Settings.GetInstance().DictAgentStatisitics = objStatBase.GetAgentValues();
                Settings.GetInstance().DictAgentObjects     = objStatBase.GetAgentObjects();

                Settings.GetInstance().DictAgentGroupStatisitics = objStatBase.GetAgentGroupValues();
                Settings.GetInstance().DictAgentGroupObjects     = objStatBase.GetAgentGroupObjects();

                MaxTags     = objStatBase.GetMaxTabs();
                ObjectIndex = 0;
                GridWidth   = new GridLength(0);
                TitleSpan   = 1;

                GridVisible = Visibility.Visible;
                logger.Debug("UserLevelStatisticsConfigViewModel : Constructor - Exit");
            }
            catch (Exception generalException)
            {
                logger.Error("UserLevelStatisticsConfigViewModel : Constructor - Exception caught" + generalException.Message.ToString());
            }
        }
예제 #19
0
        public StatisticsWindowViewModel(Window window, string SectionTitle, string statistics)
        {
            DataGridRowHeight          = new GridLength(0);
            StatisticsPropertieswindow = window;
            Section    = SectionTitle;
            Statistics = statistics;

            Dictionary <StatisticsEnum.ThemeColors, SolidColorBrush> dictTheme = new Dictionary <StatisticsEnum.ThemeColors, SolidColorBrush>();

            dictTheme          = objStatSupport.ThemeSelector(Settings.GetInstance().Theme);
            TitleBackground    = dictTheme[StatisticsEnum.ThemeColors.TitleBackground];
            BackgroundColor    = dictTheme[StatisticsEnum.ThemeColors.BackgroundColor];
            TitleForeground    = dictTheme[StatisticsEnum.ThemeColors.TitleForeground];
            BorderBrush        = dictTheme[StatisticsEnum.ThemeColors.BorderBrush];
            ShadowEffect       = new DropShadowBitmapEffect();
            ShadowEffect.Color = (Color)BorderBrush.Color;
        }
예제 #20
0
        private void Path_MouseEnter(object sender, MouseEventArgs e)
        {
            if (!((Path)sender).Equals(actualPath))
            {
                ((Path)sender).Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7B9EAE"));
                //(sender as Path).StrokeThickness = 3;
                DropShadowBitmapEffect dropShadow = new DropShadowBitmapEffect();
                dropShadow.Direction        = 270;
                dropShadow.Color            = Colors.White;
                dropShadow.Opacity          = 0.4;
                dropShadow.ShadowDepth      = 2;
                dropShadow.Softness         = 0.02;
                ((Path)sender).BitmapEffect = dropShadow;

                (sender as Path).Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF353E29"));
            }
        }
예제 #21
0
 public void WinActivated()
 {
     try
     {
         ShadowEffect             = new DropShadowBitmapEffect();
         ShadowEffect.ShadowDepth = 0;
         ShadowEffect.Opacity     = 0.5;
         ShadowEffect.Softness    = 0.5;
     }
     catch (Exception ex)
     {
     }
     finally
     {
         GC.Collect();
     }
 }
예제 #22
0
        public MainWindow()
        {
            InitializeComponent();

            cnvPuzzle.MouseLeftButtonUp += new MouseButtonEventHandler(cnvPuzzle_MouseLeftButtonUp);
            cnvPuzzle.MouseDown         += new MouseButtonEventHandler(cnvPuzzle_MouseDown);
            cnvPuzzle.MouseMove         += new MouseEventHandler(cnvPuzzle_MouseMove);
            cnvPuzzle.MouseEnter        += new MouseEventHandler(cnvPuzzle_MouseEnter);
            cnvPuzzle.MouseLeave        += new MouseEventHandler(cnvPuzzle_MouseLeave);

            shadowEffect = new DropShadowBitmapEffect()
            {
                Color       = Colors.Black,
                Direction   = 310, //кут, по якому тінь проектується
                ShadowDepth = 25,  //відстань між пазлом і його тінню
                Softness    = 1,
                Opacity     = 0.5
            };
        }
예제 #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomNotifierViewModel" /> class.
        /// </summary>
        public ThresholdNotiferViewModel(string theme, string titleBG, string titleFG, string contentBG, bool isStatBold)
        {
            ShadowEffect = new DropShadowBitmapEffect();
            object convertFromString;

            try
            {
                logger.Debug("ThresholdNotiferViewModel : Constructor : Entry");

                ShadowEffect.ShadowDepth = 0;
                ShadowEffect.Opacity     = 0.5;
                ShadowEffect.Softness    = 0.5;
                convertFromString        = ColorConverter.ConvertFromString("#003660");
                if (convertFromString != null)
                {
                    ShadowEffect.Color = (Color)convertFromString;
                }

                NotifierTheme(theme, titleBG, titleFG, contentBG);

                if (isStatBold)
                {
                    ContentWeight = FontWeights.Bold;
                }
                else
                {
                    ContentWeight = FontWeights.Normal;
                }
            }
            catch (Exception ex)
            {
                logger.Error("ThresholdNotiferViewModel : Constructor : " + ex.Message);
            }
            finally
            {
                ShadowEffect      = null;
                convertFromString = null;
                GC.Collect();
            }
            logger.Debug("ThresholdNotiferViewModel : Constructor : Exit");
        }
예제 #24
0
        private void Path_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (window1Active)
            {
                Prediction_Synthese.Close();
                window1Active              = false;
                actualPath.Fill            = App.Current.Resources["DarkBlue"] as Brush;
                actualPath.StrokeThickness = 0.5;
                actualPath.Stroke          = Brushes.White;
                actualPath.BitmapEffect    = null;
                actualPath = null;
            }
            actualPath      = (Path)sender;
            window1Active   = true;
            actualPath.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#75BAC8"));
            DropShadowBitmapEffect dropShadow = new DropShadowBitmapEffect();

            dropShadow.Direction    = 270;
            dropShadow.Color        = Colors.White;
            dropShadow.Opacity      = 0.8;
            dropShadow.ShadowDepth  = 3;
            dropShadow.Softness     = 0;
            actualPath.BitmapEffect = dropShadow;
            Prediction_Synthese.Close();
            Point p = Mouse.GetPosition(App.Current.MainWindow);

            Prediction_Synthese = new BtnOfMap(p.X, p.Y);
            if (((MainWindow)App.Current.MainWindow).WindowState.Equals(WindowState.Maximized))
            {
                Prediction_Synthese.Left = p.X - 50;
                Prediction_Synthese.Top  = p.Y;
            }
            else
            {
                Prediction_Synthese.Left = ((MainWindow)App.Current.MainWindow).Left + p.X - 50;
                Prediction_Synthese.Top  = ((MainWindow)App.Current.MainWindow).Top + p.Y;
            }

            Prediction_Synthese.Show();
        }
        public static void OnDropShadow(UIElement ob)
        {
            // Get a reference to the Button.
            var UI = ob;

            //Color = "Black"
            //            Direction = "270"
            //            ShadowDepth = "1"
            //            Softness = "0.75"
            //            Opacity = "1" />

            // Initialize a new DropShadowBitmapEffect that will be applied
            // to the Button.
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            Color myShadowColor = new Color();

            myShadowColor.ScA        = 1; // Note that the alpha value is ignored by Color property. The Opacity property is used to control the alpha.
            myShadowColor.ScB        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScR        = 0;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 270;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 1;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 0.75;

            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 1;

            // Apply the bitmap effect to the Button.
            UI.BitmapEffect = myDropShadowEffect;
        }
예제 #26
0
        private void ApplyDropShadow(DropShadowBitmapEffect effect, Rect effectInput)
        {
            RenderBuffer clone = Clone();

            clone.boundsOverride = effectInput;
            double depth       = MathEx.ConvertToAbsolutePixels(effect.ShadowDepth);
            double angle       = MathEx.ToRadians(effect.Direction);
            Vector pixelOffset = new Vector(depth * Math.Cos(angle), depth * Math.Sin(-angle));
            Color  effectColor = effect.Color;

            effectColor = ColorOperations.ScaleAlpha(effectColor, effect.Opacity);
            double blurRadius = 1.0 + (effect.Softness * 9.0);

            int xEnd = (int)effectInput.Right;
            int yEnd = (int)effectInput.Bottom;

            for (int y = (int)effectInput.Y; y < yEnd; y++)
            {
                for (int x = (int)effectInput.X; x < xEnd; x++)
                {
                    Point point = new Point(x + Const.pixelCenterX, y + Const.pixelCenterY) - pixelOffset;
                    Color?color = clone.GetPixelSample(point, blurRadius);

                    if (color.HasValue)
                    {
                        double opacity = ColorOperations.ByteToDouble(color.Value.A);
                        Color  shadow  = ColorOperations.ScaleAlpha(effectColor, opacity);
                        shadow            = ColorOperations.PreMultiplyColor(shadow);
                        frameBuffer[x, y] = ColorOperations.PreMultipliedAlphaBlend(clone.frameBuffer[x, y], shadow);

                        if (frameBuffer[x, y] != clone.frameBuffer[x, y])
                        {
                            // Transfer the tolerance (silhouette, etc) over too
                            Color tolerance = clone.GetToleranceSample(point, blurRadius);
                            toleranceBuffer[x, y] = ColorOperations.Max(tolerance, clone.toleranceBuffer[x, y]);
                        }
                    }
                }
            }
        }
예제 #27
0
        public MainWindow()
        {
            InitializeComponent();

            destFileName = Settings.Default.DestinationFile;

            cnvPuzzle.MouseLeftButtonUp += new MouseButtonEventHandler(cnvPuzzle_MouseLeftButtonUp);
            cnvPuzzle.MouseDown         += new MouseButtonEventHandler(cnvPuzzle_MouseDown);
            cnvPuzzle.MouseMove         += new MouseEventHandler(cnvPuzzle_MouseMove);
            cnvPuzzle.MouseWheel        += new MouseWheelEventHandler(cnvPuzzle_MouseWheel);
            cnvPuzzle.MouseEnter        += new MouseEventHandler(cnvPuzzle_MouseEnter);
            cnvPuzzle.MouseLeave        += new MouseEventHandler(cnvPuzzle_MouseLeave);

            shadowEffect = new DropShadowBitmapEffect()
            {
                Color       = Colors.Black,
                Direction   = 320,
                ShadowDepth = 25,
                Softness    = 1,
                Opacity     = 0.5
            };
        }
예제 #28
0
        public void ReleaseDrag()
        {
            //Hide/Animate DropShadow
            DropShadowBitmapEffect dps = this.sContainer.BitmapEffect as DropShadowBitmapEffect;

            DoubleAnimation animHideDropShadow = new DoubleAnimation(0, 5, TimeSpan.FromMilliseconds(100));

            animHideDropShadow.Completed += new EventHandler(animHideDropShadow_Completed);
            Storyboard.SetTargetName(animHideDropShadow, dps.GetValue(NameProperty).ToString());
            Storyboard.SetTargetProperty(animHideDropShadow, new PropertyPath(DropShadowBitmapEffect.ShadowDepthProperty));
            Storyboard storyHideDrop = new Storyboard();

            storyHideDrop.Children.Add(animHideDropShadow);
            storyHideDrop.Begin(this.sContainer);

            //Resize Window
            this.Height -= 10;
            this.Width  -= 10;

            //Restore Canvas Bindings
            SetContainerCanvasBindings(SetBindingMode.SetBinding);
        }
        public void SetShadow()
        {
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            Color myShadowColor = Color;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = Direction;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = Softness;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = Opacity;

            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = Opacity;

            // Apply the bitmap effect to the Button.
            Control.BitmapEffect = myDropShadowEffect;
        }
예제 #30
0
        //Tạo bóng đỏ cho hình
        private void SetDropShadowEffect()
        {
            myDropShadowEffect = new DropShadowBitmapEffect();
            // Set the color of the shadow to Black.
            myShadowColor            = new Color();
            myShadowColor.ScA        = 1;
            myShadowColor.ScB        = 5;
            myShadowColor.ScG        = 5;
            myShadowColor.ScR        = 5;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 0;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 5;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 10;
            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 0.5;
        }