Open robertdolca opened 8 years ago
Likely that it is! Can you provide a snippet for a minimal working example of the problem with expected behavior?
InputStream is = response.body().byteStream();
Drawable drawable = Sharp.loadInputStream(is).getDrawable(imageView);
drawable.setAlpha(0);
imageView.setImageDrawable(drawable);
Expected behaviour: a transparent image Result: an non-transparent image (the original image - unchanged) It also ignores filters.
If you would like I can make a runnable example.
I'm afraid these stub methods from PictureDrawable are not implemented in SharpDrawable:
setFilterBitmap(boolean filter)
setDither(boolean dither)
setColorFilter(ColorFilter colorFilter)
setAlpha(int alpha)
I'm not certain if there's a trivial way of accomplishing any of this, but perhaps applying canvas.saveLayerAlpha()
at the level of SharpDrawable prior to actually drawing the Picture would achieve the desired effect for setAlpha()
.
I may look into this in a future version, but for now, PRs are welcome!
I tried applying a filter to the drawable and then loading it in a ImageView. Any filter I tried is ignored. Even changing the opacity has no effect. Is this due to the library's implementation?
Thanks