Beispiel #1
0
        public void ApplyFilter(Object passedObj, Object dontCare = null)
        {
            double value = Convert.ToDouble(passedObj);

            if (value == 0)
            {
                Image image = m_ToolBarItem.Content as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-Sharpen;component/SharpenOff.png", UriKind.Relative));

                dockPanel.Effect  = null;
                m_PopUpItem.Value = 0;
            }
            else
            {
                Image image = m_ToolBarItem.Content as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-Sharpen;component/SharpenOn.png", UriKind.Relative));

                SharpenEffect sharpedEffect = new SharpenEffect();
                sharpedEffect.InputSize = new Size(Width, Height);
                sharpedEffect.Amount    = value;
                dockPanel.Effect        = sharpedEffect;
                m_PopUpItem.Value       = value;
            }
        }
Beispiel #2
0
        public void ApplyFilter (Object passedObj, Object dontCare = null)
        {
            double value = Convert.ToDouble(passedObj);

            if (value == 0)
            {
                Image image = m_ToolBarItem.Content as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-Sharpen;component/SharpenOff.png", UriKind.Relative));

                dockPanel.Effect = null;
                m_PopUpItem.Value = 0;
            }
            else
            {
                Image image = m_ToolBarItem.Content as Image;
                image.Source = new BitmapImage(new Uri(@"/L3Filter-Sharpen;component/SharpenOn.png", UriKind.Relative));

                SharpenEffect sharpedEffect = new SharpenEffect();
                sharpedEffect.InputSize = new Size(Width, Height);
                sharpedEffect.Amount = value;
                dockPanel.Effect = sharpedEffect;
                m_PopUpItem.Value = value;
            }
        }