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

Support for other bitmap formats (not just default RGB565) #349

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

dhabensky
Copy link
Contributor

Decoder's preferred bitmap format can be altered.

  1. create factory
    DecoderFactory<? extends ImageDecoder> factory = new CompatDecoderFactory<>(SkiaImageDecoder.class, Bitmap.Config.ARGB_8888);
    Second argument is optional, therefore the default behavior is not changed.

  2. configure view with created factory
    mView.setBitmapDecoderFactory(factory);

Why this feature is needed?
I have an image with a background color (for example a plan of a building) and i want to set background of my view the same color thus making borders invisible.
But if the image is displayed as RGB565 colors will be a bit different making this border visible.

@davemorrissey davemorrissey merged commit 26fd174 into davemorrissey:master Oct 19, 2017
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.

2 participants