基本信息
源码名称:c#50多种图像处理工具算法程序
源码大小:1.40M
文件格式:.zip
开发语言:C#
更新时间:2019-07-08
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 5 元 
   源码介绍

50种图像处理工具C#源码,常见的photo shop滤镜算法都有,100%保证高效快捷

 protected override void OnPaint( PaintEventArgs e )
        {
            if ( bitmap != null )
            {
                Graphics g = e.Graphics;
                Rectangle rc = ClientRectangle;
                Pen pen = new Pen( Color.FromArgb( 0, 0, 0 ) );

                int x = ( rc.Width < width ) ? this.AutoScrollPosition.X : ( rc.Width - width ) / 2;
                int y = ( rc.Height < height ) ? this.AutoScrollPosition.Y : ( rc.Height - height ) / 2;

                // draw rectangle around the image
                g.DrawRectangle( pen, x - 1, y - 1, width 1, height 1 );

                // draw image
                g.DrawImage( bitmap, x, y, width, height );

                pen.Dispose( );
            }
        }

        // Backward Fourier transformation
        private void backwardFourierItem_Click( object sender, System.EventArgs e )
        {
            ComplexImage cimg = (ComplexImage) image.Clone( );

            cimg.BackwardFourierTransform( );
            host.NewDocument( cimg.ToBitmap( ) );
        }

        // Frequency filter
        private void frequencyFilterFourierItem_Click( object sender, System.EventArgs e )
        {
            FrequencyFilter form = new FrequencyFilter( );

            form.InputRange = new IntRange( 0, width >> 1 );
            form.OutputRange = new IntRange( 0, width >> 1 );

            if ( form.ShowDialog( ) == DialogResult.OK )
            {
                backup = (ComplexImage) image.Clone( );

                image.FrequencyFilter( form.OutputRange );
                UpdateNewImage( );
            }
        }

        // Undo filter
        private void undoFourierItem_Click( object sender, System.EventArgs e )
        {
            if ( backup != null )
            {
                image = backup;
                backup = null;
                UpdateNewImage( );
            }
        }

        // On "Fourier" menu popup
        private void fourierItem_Popup( object sender, System.EventArgs e )
        {
            undoFourierItem.Enabled = backup != null;
        }