-
Notifications
You must be signed in to change notification settings - Fork 2k
glide中加载图片density不一致导致bitmap大小不一致 #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
因为我这边发现是在transform方法中调用了 |
原因是调用 Bitmap.createBitmap(width, height, Bitmap.Config.XXX) 函数创建 Bitmap 时,它的 mDensity 属性用的是默认值,追踪源码可以看出来:http://androidxref.com/9.0.0_r3/xref/frameworks/base/core/jni/android/graphics/Bitmap.cpp#Bitmap_creator
所以修改 sDefaultDensity 的值就好了,可以通过反射:
|
glide加载完图片打印图片density,density不一致,glide有操作会修改density嘛?glide版本4.4.0

有时候240,有时候是333,应该都是333.
我这边imageview宽高自适应的,所以显示大小也不一致。
The text was updated successfully, but these errors were encountered: