Android: Get size of Wallpaper -
I have to keep the default size of the wallpaper for the crop intent, because then the user can crop the image to the right size for the wallpaper .
I tried it with
wallpaper. GetApplicationContext ()). GetMinimumHeight () for GetDrawable () width; // width
or
for WallpaperManager.testence (getApplicationContext ()). GetDesiredMinimumHeight (); // the same width
but it says 960x960 on Samsung Galaxy S4 Mini and can not happen. In my HTC One V it says 960x800 may be it, but I think it's not perfect.
Do you know any way to find the size of the wallpaper? This screen is not enough for the dimension, because eg My HTC Wallpaper is larger than the screen because the wallpaper wipes left or right, because the wallpaper runs.
You can try to convert your wallpaper into a picture and then width and height from it You can get:
WallpaperManager wpm = WallpaperManager.getInstance (getApplicationContext ()); Dry D = wpm.getDrawable (); Int width = d.getIntrinsicWidth (); Int height = d.getIntrinsicHeight ();
Or enter the bitmap:
bmp = ((bitmaprvable) d) .getBitmap (); Width = bmp.getWidth (); Height = bmp.getHeight ();
Comments
Post a Comment