BitmapDrawable localBitmapDrawable = new BitmapDrawable(paramBitmap);原本的density
[quote]paramBitmap240[/quote]
变成了
[quote]localBitmapDrawable 160[/quote]
lookit
/**
* Create drawable from a bitmap, setting initial target density based on
* the display metrics of the resources.
*/
public BitmapDrawable(Resources res, Bitmap bitmap) {
this(new BitmapState(bitmap), res);
mBitmapState.mTargetDensity = mTargetDensity;
}纠结了好多天了!
本文探讨了BitmapDrawable在创建过程中密度发生变化的问题。原本的Bitmap密度为240,在转换成BitmapDrawable后密度变为160。文章深入研究了BitmapDrawable构造函数内部实现,揭示了这一现象背后的原因。
627

被折叠的 条评论
为什么被折叠?



