Drawable.createFromPath will not have the context information thus cannot scale the bitmap properly (because it does not know screen density etc).
As you can see in the source code, it will call drawableFromBitmap(null, bm, null, null, pathName)
. The first parameter (null
) is the resources reference.
Instead, use a constructor that receives the Context
or Resources
so that it can scale it bitmap properly.
Check new BitmapDrawable(Resources res, String path)
You can see that the BitmapDrawable constructors which do not receive the resources are deprecated.