私は現在、さまざまな画面サイズに合わせてビットマップを再調整する際に機能する次のようなコードを使用しています。
A.back = GPATools.ResizeTransparentBitmap(A.back, 150, 37,
Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FIT);
ただし、アプリをロードするたびにサイズを変更するのに時間がかかるため、次のコードを使用するように言われました。
class PersistableBitmap implements Persistable {
int width;
int height;
int[] argbData;
public PersistableBitmap(Bitmap image){
width = image.getWidth();
height = image.getHeight();
argbData =new int[width * height];
image.getARGB(argbData,0, width,0,0, width, height);
}
public Bitmap getBitmapImage(){
Bitmap image =new Bitmap(width, height);
image.setARGB(argbData,0, width,0,0, width, height);
return image;
}
私の問題は、2つを一緒に実装する方法がわからないことです! 男/ギャルを助けてください、どうもありがとう!