I've been troubled by image rounding recently. Many methods on the Internet can round image corners normally. But when I use it, the rounded corners are a bit sharp, not smooth at all. I use Glide to get the image. Glide also has BitmapTransformation to expand and implement rounded corners, but the effect I show is not very good. In the end, I concluded that it is because Glide compresses the pixels of the image and reduces the resolution, resulting in poor rounded corners. I couldn't find a solution on the Internet, so I tried to find a solution myself. Without further ado, let's see the implementation.
This method is only suitable for pictures with small resolution. If the resolution is too high, the angle will not be round. 1. Customize ImageView and rewrite the ondraw method
3. Ok, that's it. The idea is to take the graphics within the rounded rectangle display range |
<<: Android design pattern singleton mode
>>: iOS: Let's talk about Designated Initializer
Calcium plays a vital role in the formation of hu...
The first human flight across the Pacific Ocean w...
Hello everyone, I am the cute little carbon dioxi...
In this weather Take a nice hot bath before going...
...
The liver has the greatest regenerative capacity ...
Recently, a friend asked me this question: "...
On November 22, along with the release of the 201...
Introduction: I don’t know when it started, but t...
At the recent Smartisan T2 launch event, Luo'...
For many students who are studying abroad and hav...
A bird's eye view of science Quanzhou Associa...
On March 30, Microsoft was reportedly testing sof...
Last year, I started to coordinate the operation ...