سلام
1- من چطور میتونم از 0XFF در برنامه نویسی اندروید استفاده کنم یعنی منطورم اینه که بتونم این متغییر در یک بایت ذخیره کنم
کد HTML:
try {
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
// get pixel color
pixel = photo.getPixel(x, y);
A = Color.alpha(pixel);
R = Color.red(pixel);
G = Color.green(pixel);
B = Color.blue(pixel);
int gray = (int) (0.2989 * R + 0.5870 * G + 0.1140 * B);
// use 128 as threshold, above -> white, below -> black