Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
  2. final Drawable wallpaperDrawable = wallpaperManager.getDrawable();
  3. Bitmap bitmap = ((BitmapDrawable)wallpaperDrawable).getBitmap();
  4.  
  5. WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);
  6. Drawable wallpaperDrawable = wallpaperManager.getDrawable();
  7. Bitmap bm = ((BitmapDrawable) wallpaperDrawable).getBitmap();
  8.  
  9. ImageView imageView = ((ImageView)v);
  10. Bitmap bitmap = ((BitmapDrawable)imageView.getDrawable()).getBitmap();
  11. int pixel = bitmap.getPixel(x,y);
  12. int redValue = Color.red(pixel);
  13. int blueValue = Color.blue(pixel);
  14. int greenValue = Color.green(pixel);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement