Je fais une application de fond d'écran, j'ai un problème: lorsque j'essaie de cliquer sur le bouton "Définir l'arrière-plan", il définit l'arrière-plan, mais il est zoomé et à cause de cela j'ai perdu la moitié de mon image originale. Voici le code que j'utilise:Fond d'écran problème, l'image est agrandie lorsque j'appuie sur fond d'écran
try {
Display d = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int width = d.getWidth();
int height = d.getHeight();
WallpaperManager wallpaperManager = WallpaperManager.getInstance(view.getContext());
Bitmap bitmap = null;
bitmap = Bitmap.createScaledBitmap(bmpWallpaper, width, height, false);
wallpaperManager.setBitmap(bitmap);
Core.makeNotification(view.getContext(), "MyNotification", "Your wallpaper has been set, enjoy!");
Core.makeAlert(view.getContext(), "Wallpaper set", "Your wallpaper has been set, enjoy!");
} catch (IOException e) {
e.printStackTrace();
}