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

Picture just get "blown-up" when I use RoundingParams to get a rounded corner picture #2763

Open
armanniu010 opened this issue Mar 17, 2024 · 0 comments

Comments

@armanniu010
Copy link

armanniu010 commented Mar 17, 2024

Description

I found an issue that seemed to be caused by RoundingParams, but was actually related to the mTargetDensity of the BitmapDrawable which used in RoundedBitmapDrawable

When the density changed by App-Self, the issue maybe appeared.
e.g. AndroidAutoSize

I want to getting this:
image

But got this:
image

Reproduction

image

Reason

The "blown-up" effect is the result of the updateTransform function:

Trace the following code:

Bitmap which used in RoundedBitmapDrawable was from this code:

decodedBitmap = BitmapFactory.decodeStream(inputStream, null, options);

The density of the bitmap which is created in DefaultDecoder is default, but when update transform in RoundedDrawable will use resource density which is changed by App-Self to measure transform

Expected

Now, I solved it, by updating density of bitmap in some custom class, such as DrawableFactory or Postprocessor, but it's probably not safe, I hope to get a formal solution

@armanniu010 armanniu010 changed the title Picture just get "blown up" when I use RoundingParams to get a rounded corner picture Picture just get "blown-up" when I use RoundingParams to get a rounded corner picture Mar 17, 2024
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

No branches or pull requests

1 participant