8.获得图片的倒影,同时倒影渐变效果:
- /** * @param bitmap 图片源
- * @return 处理后的图片Bitmap对象 */
- public static Bitmap createMirro(Bitmap bitmap) { int width = bitmap.getWidth();
- int height = bitmap.getHeight(); int shadow_height = 15;
- int[] pixels = new int[width * height]; bitmap.getPixels(pixels, 0, width, 0, 0, width, height);
- // shadow effect int alpha = 0x00000000;
- for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) {
- int index = y * width + x; int r = (pixels[index] >> 16) & 0xff;
- int g = (pixels[index] >> 8) & 0xff; int b = pixels[index] & 0xff;
- pixels[index] = alpha | (r << 16) | (g << 8) | b; }










