RequestOptions options = new RequestOptions().bitmapTransform(new
RoundedCorners(30));
Glide.with(getContext()).load(result.getImage())
.apply(options)
.error(R.drawable.error)
.into(getView().getImage());
```java
/**
* 矩形 轮廓
*/
public class TextureVideoViewOutline extends ViewOutlineProvider {
float mRadius;
public TextureVideoViewOutline(float mRadius) {
this.mRadius = mRadius;
}
@Override
public void getOutline(View view, Outline outline) {
Rect rect = new Rect();
view.getGlobalVisibleRect(rect);
int leftMargin = 0;
int topMargin = 0;
Rect selfRect = new Rect(leftMargin, topMargin,
rect.right - rect.left - leftMargin, rect.bottom - rect.top - topMargin);
outline.setRoundRect(selfRect, mRadius);
}
}
//使用
view.setOutlineProvider(new TextureVideoViewOutline(30));
view.setClipToOutline(true);