Skip to content

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

Open
@armanniu010

Description

@armanniu010

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions