public static bool IsBound(Bitmap image, int xx, int yy) { if (xx >= 0 && xx < image.Width && yy >= 0 && yy < image.Height) { return true; } else { return false; } }