tgoop.com/CsharpWindowsForm/231
Last Update:
قم بإضافة هذه الاسطر الى الكود
r = 255 - r;
g = 255 - g;
b = 255 - b;
وايضاً قم بالتعديل في الدالة التالية
RedBmp.SetPixel(x, y, Color.FromArgb(a, r, g, b));
كود هذا الشكل
Bitmap bmp = new Bitmap(pictureBox1.Image);
int width = bmp.Width;
int height = bmp.Height;
Bitmap RedBmp = new Bitmap(bmp);
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
//get pixel value
Color p = bmp.GetPixel(x, y);
//extract ARGB value from p
int a = p.A;
int r = p.R;
int g = p.G;
int b = p.B;
r = 255 - r;
g = 255 - g;
b = 255 - b;
//set red image pixel
RedBmp.SetPixel(x, y, Color.FromArgb(a, r, g, b));
}
}
pictureBox2.Image = RedBmp;
BY برمجة تطبيقات الويندوز C# Programming

Share with your friend now:
tgoop.com/CsharpWindowsForm/231