Exemplo n.º 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-EdgeEnhancement;component/EdgeEnhancementOff.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-EdgeEnhancement;component/EdgeEnhancementOn.png", UriKind.Relative));

                ParametricEdgeDetectionA pes = new ParametricEdgeDetectionA();
                // set default
                pes.Threshhold    = 1.0;
                pes.K00           = m_PopUpItem.Maximum - value;
                pes.K01           = m_PopUpItem.Maximum - value;
                pes.K02           = m_PopUpItem.Maximum - value;
                pes.TextureSize   = new Point(Width, Height);
                pes.StartPoint    = new Point(0, 0);
                pes.EndPoint      = new Point(1, 1);
                dockPanel.Effect  = pes;
                m_PopUpItem.Value = value;
            }
        }
Exemplo n.º 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-EdgeEnhancement;component/EdgeEnhancementOff.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-EdgeEnhancement;component/EdgeEnhancementOn.png", UriKind.Relative));

                ParametricEdgeDetectionA pes = new ParametricEdgeDetectionA();
                // set default
                pes.Threshhold = 1.0;
                pes.K00 = m_PopUpItem.Maximum - value;
                pes.K01 = m_PopUpItem.Maximum - value;
                pes.K02 = m_PopUpItem.Maximum - value;
                pes.TextureSize = new Point(Width, Height);
                pes.StartPoint = new Point(0, 0);
                pes.EndPoint = new Point(1, 1);
                dockPanel.Effect = pes;
                m_PopUpItem.Value = value;
            }
        }