واسه تیکه ی pixelate کردن این کد رو نوشتم. ببین به کارت میاد یا نه. فقط به 2 تا نکته توجه کن
1. فرض کردم یه picturebox داری و توش اون عکسی که میخوای pixelate بکنیش load شده باشه
2. با تغییر مقدار step مقدار pixelate شدن عکس فرق میکنه
کد:
int step = 10;
Bitmap myImage = (Bitmap)pictureBox1.Image;
for (int i = step; i < myImage.Width; i += (2 * step))
{
for (int j = step; j < myImage.Height; j += (2 * step))
{
for (int x = i - step; ((x <= (i + step)) && x < myImage.Width); x++)
{
for (int y = j - step; ((y <= (j + step)) && y < myImage.Height); y++)
{
myImage.SetPixel(x, y, myImage.GetPixel(i, j));
}
}
}
}
pictureBox1.Image = myImage;