Load image in device independent and screen independent fashion into a layout view using 1.6 SDK

Posted by Mark Wigzell on Stack Overflow See other posts from Stack Overflow or by Mark Wigzell
Published on 2010-03-31T00:09:07Z Indexed on 2010/03/31 0:13 UTC
Read the original article Hit count: 714

Filed under:
|
|
|

I'm having trouble getting an asset image to scale up when I load it. The new call to BitmapDrawable(Resources, BitmapDrawable) is not available on 1.6 SDK. Is there a workaround to load the BitmapDrawable the old way and then somehow manipulate it? I have tried calling setTargetDensity() to no avail. My code (which doesn't scale properly) is:

    ImageView iv = (ImageView)view.findViewById(R.id.image);
 iv.setImageDrawable(new BitmapDrawable(view.getContext().getAssets().open(path)));

© Stack Overflow or respective owner

Related posts about scale

Related posts about density