You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I believe the way Android decodes PNG (w/ alpha) image is different. To fix this, the best way is to use BlendFunc.getPremultipliedAlpha() or BlendModes.PREMULTIPLIED_ALPHA_FUNC (they are the same).
You might consider to do texture.setFilters(GL10.GL_LINEAR, GL10.GL_LINEAR) for better render.
By default it uses GL10.GL_NEAREST which renders faster but is lower quality.
On a related note, if you're building a full application, extend or modify Pure2dApplication which allows to you config stuff including textures, fonts,... from a json file: ui_config.json.
Hi, @longngo78
I have png image with transparency.
When using it as a texture I get the following (left is screenshot from device, right is the image itself)
Default blending and bitmap config, nothing changed anywhere.
Here is the code :)
The same drawable in ImageView looks perfect.
EDIT:
Using
BlendFunc.getPremultipliedAlpha()
makes everything work. But why?The text was updated successfully, but these errors were encountered: