private void OverCursorOperation(int x, int y, OnPixelOperation operation) { int[,] coeffs = { { 1, 0, 0, -16 }, { 1, 0, 0, 16 }, { 0, -16, 1, 0 }, { 0, 16, 1, 0 } }; int idx = 0; for (int k = 0; k < 4; k++) { int a = coeffs[k, 0]; int b = coeffs[k, 1]; int c = coeffs[k, 2]; int d = coeffs[k, 3]; for (int i = -16; i < 17; i++) { operation(idx, x + a * i + b, y + c * i + d); idx++; } } }
private void OverCursorOperation(int x, int y, OnPixelOperation operation) { int[,] coeffs = { { 1, 0, 0, -16 }, { 1, 0, 0, 16 }, { 0, -16, 1, 0 }, { 0, 16, 1, 0 } }; int idx = 0; for (int k = 0; k < 4; k++) { int a = coeffs[k, 0]; int b = coeffs[k, 1]; int c = coeffs[k, 2]; int d = coeffs[k, 3]; for (int i = -16; i < 17; i++) { operation(idx, x + a * i + b, y + c * i + d); idx++; } } }