دانلود سورس فیلتر عکس با سی شارپ #C

دانلود سورس فیلتر عکس با سی شارپ #C
سورس کدی که در این قسمت میتوانید دانلود کنید، سورس جالب فیلتر عکس با زبان سی شارپ #C میباشد.
در این سورس که خیلی زیبا و کاربردی طراحی شده است، میتوانید عکسی را به دلخواه وارد برنامه کنید و با استفاده از گزینه "Negative" آنرا نگاتیو سازی کنید و یا با کلیک روی دکمه "GrayScale" تصویر سیاه و سفید عکس را بسازید. هر دو تصویر اولیه وارد شده و تصویر تغییر یافته را در کادر مخصوص در فرم میتوانید ببینید.در ضمن مییتوانید تصویر تغییر یافته را در هر آدرسی که مایل بودید ذخیره نمایید.
سورس اصلی فیلتر عکس با سی شارپ را میتوانید از پایین صفحه دانلود نمایید.
برنامه فیلتر عکس را که در تمام نسخه های ویژوال استودیو قابل استفاده است در زیر مشاهده میکنید.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string FileDialogString;
Boolean ch = false;
Bitmap BmpImage, BmpOK;
Color TempPixel;
private void panel2_Click(object sender, EventArgs e)
{
Close();
}
private void panel1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp| All Files(*.*)|*.*";
openFileDialog1.FilterIndex = 1;
openFileDialog1.Title = "Open a Picture...";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
FileDialogString = openFileDialog1.FileName;
PBox2.Load(FileDialogString);
PBox1.Load(FileDialogString);
BmpImage = new Bitmap(FileDialogString);
BmpOK = BmpImage;
ch = true;
}
}
private void panel3_Click(object sender, EventArgs e)
{
if (ch == true)
{
Bitmap bmpimage2 = new Bitmap(BmpImage);
int i, j, AvePixel;
progressBar1.Visible = true;
progressBar1.Maximum = BmpImage.Width;
for (i = 0; i < BmpImage.Width; i++)
{
progressBar1.Value++;
for (j = 0; j < BmpImage.Height; j++)
{
TempPixel = BmpImage.GetPixel(i, j);
AvePixel = (TempPixel.R + TempPixel.B + TempPixel.G) / 3;
bmpimage2.SetPixel(i, j, Color.FromArgb(255 - TempPixel.R, 255 - TempPixel.G, 255 - TempPixel.B));
}
}
progressBar1.Visible = false;
progressBar1.Value = 0;
PBox2.Image = bmpimage2;
BmpOK = bmpimage2;
ch = false;
}
else
{
MessageBox.Show("Please Load a picture", "Picture not Exist", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void panel4_Click(object sender, EventArgs e)
{
if (ch == true)
{
Bitmap bmpimage2 = new Bitmap(BmpImage);
int i, j, AvePixel;
progressBar1.Visible = true;
progressBar1.Maximum = BmpImage.Width;
for (i = 0; i < BmpImage.Width; i++)
{
progressBar1.Value++;
for (j = 0; j < BmpImage.Height; j++)
{
TempPixel = BmpImage.GetPixel(i, j);
AvePixel = (TempPixel.R + TempPixel.B + TempPixel.G) / 3;
bmpimage2.SetPixel(i, j, Color.FromArgb(AvePixel, AvePixel, AvePixel));
}
}
progressBar1.Visible = false;
progressBar1.Value = 0;
PBox2.Image = bmpimage2;
BmpOK = bmpimage2;
ch = false;
}
else
{
MessageBox.Show("Please Load a picture", "Picture not Exist", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://WWw.SourceCodes.ir");
}
}
}
بصورت رایگان سورس کد فیلتر عکس با #C را از این قسمت دانلود کنید
حجم فایل 5.88 MB