private Bitmap Baohedu(Bitmap oop, int xa, int xb, int ya, int yb){Bitmap nop;nop = oop.Clone() as Bitmap;double degree = trackBar2.Value / 50;int x, y;Color pixel;double R = 0, G = 0, B = 0, H = 0, S = 0, V = 0;double max = 0, min = 0;for (x = xa; x < xb; x++){for (y = ya; y < yb; y++){pixel = oop.GetPixel(x, y);R = (double)pixel.R;G = (double)pixel.G;B = (double)pixel.B;R = R / 100; G = G / 100; B = B / 100;max = Max(R, G, B);min = Min(R, G, B);V = max;if (max == 0) S = 0;else S = 1 - (min / max);if (max == min) H = 0;else if (max == R && G >= B) H = 60 * ((G - B) / (max - min));else if (max == R && G < B) H = 60 * ((G - B) / (max - min)) + 360;else if (max == G) H = 60 * ((B - R) / (max - min)) + 120;else if (max == B) H = 60 * ((R - G) / (max - min)) + 240;V = V * 100; S = S * 100; S = S * degree;if (S >= 100) S = 100;double C = 0, X = 0, Y = 0, Z = 0;int i = 0;S = S / 100.0;V = V / 100.0;if (S == 0) R = G = B = V;else{H = H / 60;i = (int)H;C = H - i;X = V * (1.0 - S);Y = V * (1 - S * C);Z = V * (1 - S * (1 - C));switch (i){case 0: R = V; G = Z; B = X; break;case 1: R = Y; G = V; B = X; break;case 2: R = X; G = V; B = Z; break;case 3: R = X; G = Y; B = V; break;case 4: R = Z; G = X; B = V; break;case 5: R = V; G = X; B = Y; break;}}R = R * 100; G = G * 100; B = B * 100;if (G >= 255) G = 255;if (R >= 255) R = 255;if (B >= 255) B = 255;if (G <= 0) G = 0;if (R <= 0) R = 0;if (B <= 0) B = 0;nop.SetPixel(x, y, Color.FromArgb((int)R, (int)G, (int)B));}}return nop;}private double Max(double a, double b, double c){double max = 0;max = a;if (max < b)max = b;if (max < c)max = c;return max;}private double Min(double a, double b, double c){double min = 0;min = a;if (min > b)min = b;if (min > c)min = c;return min;}