嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 5 元微信扫码支付:5 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
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;
}