Shuhrat-java / android-pinch

Automatically exported from code.google.com/p/android-pinch
0 stars 0 forks source link

Does not work for large images passed with view.setImageBitmap(bm); #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to use this to display a very large image (8M)

Simply setting the image src in the layout causes a VM error because it's 
too large.

So the solution is:

        view = (PinchImageView) findViewById(R.id.image);

        BitmapFactory.Options options=new BitmapFactory.Options();
        options.inSampleSize = 10;
        Bitmap bm = 
BitmapFactory.decodeResource(getBaseContext().getResources(), 
R.drawable.pic, options);

        view.setImageBitmap(bm);

When doing this, bitmap loads, however, it is entirely static and doesn't 
respond to any touch events. This is A2.1 on a Nexus One.

Any thoughts on this?

Original issue reported on code.google.com by miser...@gmail.com on 25 Mar 2010 at 1:20

GoogleCodeExporter commented 8 years ago
In v0.8, the WebImageView now creates a ByteArrayInputStream for
BitmapFactory.decodeByteArray, instead of BitmapFactory.decodeStream. This has 
worked
for bigger images, though I haven't tested 8M. Let me know if you encounter 
issues
still. 

Original comment by nikko.ai...@gmail.com on 7 Apr 2010 at 3:17