Skip to content
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

Load sampled down bitmaps #213

Open
wants to merge 1 commit into
base: GLES2
Choose a base branch
from

Conversation

flomin
Copy link

@flomin flomin commented Apr 11, 2013

This patch is based on the Android developer training Loading Large Bitmaps Efficiently

It enables to use the method AssetBitmapTextureAtlasSource.createSampled to create a scaled down version of a bitmap into memory, for example to display a thumbnail of a big image: e.g.: an image of 2048x1536 (12Mb in memory) can be sampled down to 512x384 (0.75Mb in memory).

It sets the inSampleSize of BitmapFactory.Options object of the BitmapFactory.decodeResource method.

This sample value can only be integer and power of two are faster and more efficient for the decoder.

This patch is based on the Android developer training 'Loading Large Bitmaps Efficiently': http://developer.android.com/training/displaying-bitmaps/load-bitmap.html
It enables to use the method AssetBitmapTextureAtlasSource.createSampled to create a scaled down version a a bitmap into memory, for example to display a thumbnail of a big image.
It sets the inSampleSize of BitmapFactory.Options object of the BitmapFactory.decodeResource method.
This sample value can only be integer and power of two are faster and more efficient for the decoder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant