J'ai un bitmap de mon fond d'écran actuel. J'ai besoin de recadrer pour mettre derrière une mise en page. Le principal problème auquel je fais face est le recadrage de ce bitmap. Voici mon code.comment recadrer bitmap de fond d'écran
Bitmap icon = utiles.drawableToBitmap(wallpaperDrawable);
blurredBitmap = BlurBuilder.blur(this, icon);
public void drawBlurImage() {
if (resizedBitmap == null &&getHeight()!=0) {
resizedBitmap = Bitmap.createBitmap(CategoriesActivity.blurredBitmap, dpToPx(80), dpToPx(64), getWidth()-dpToPx(165), getHeight()-dpToPx(30));
resizedBitmap = Bitmap.createScaledBitmap(resizedBitmap, this.getWidth(), this.getHeight(), true);
invalidate();
}
// Drawable drawable = new BitmapDrawable(getContext().getResources(), resizedBitmap);
}
voici ce que j'ai donc far.You peut voir dans l'image bitmap de flou est pas correctement derrière deux applications. ci-dessous est le code qui est pour recadrer un bitmap, j'ai fixé la valeur fixe pour un autre fond d'écran qui montre bien, mais ce n'est pas bon pour chaque fond d'écran.
resizedBitmap = Bitmap.createBitmap(CategoriesActivity.blurredBitmap, dpToPx(80), dpToPx(64), getWidth()-dpToPx(165), getHeight()-dpToPx(30));
Des suggestions seront appréciées.