当前位置: 首页 > news >正文

Android transform旋转rotate圆角矩形图roundedCorners,Kotlin

Android transform旋转rotate圆角矩形图roundedCorners,Kotlin

import android.graphics.Bitmap
import android.os.Bundle
import android.util.Log
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.TransformationUtilsclass MainActivity : AppCompatActivity() {private val TAG = "fly/${this::class.simpleName}"override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)val imageView = findViewById<ImageView>(R.id.image)GlideApp.with(this).load(R.mipmap.pic2).transform(RotateRoundedCorners()).override(500, 500).into(imageView)}inner class RotateRoundedCorners : CenterCrop() {override fun transform(pool: BitmapPool,toTransform: Bitmap,outWidth: Int,outHeight: Int): Bitmap {Log.d(TAG, "$outWidth $outHeight ${toTransform.byteCount}")//先变换成圆角矩形(50)。val bmp = TransformationUtils.roundedCorners(pool, toTransform, 50)//再逆向旋转30度。return TransformationUtils.rotateImage(bmp, -30)}}
}

Glide transform CircleCrop()圆图,Kotlin-CSDN博客文章浏览阅读369次。文章浏览阅读1.2w次。引入: implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'Android标准Glide加载圆形图和圆角矩形图_android glide加载圆角-CSDN博客。Glide transform CircleCrop()圆图,Kotlin。https://blog.csdn.net/zhangphil/article/details/134147774

相关文章:

  • uniapp中地图定位功能实现的几种方案
  • Technology Strategy Pattern 学习笔记2-Creating the Strategy-World Context
  • 【系统架构设计】架构核心知识:4 系统可靠性分析与设计
  • 华为机试练习题:HJ11 数字颠倒
  • 【MongoDB】索引 - 单字段索引
  • 记一次经典SQL双写绕过题目[极客大挑战 2019]BabySQL 1
  • 机器视觉 opencv 深度学习 驾驶人脸疲劳检测系统 -python 计算机竞赛
  • react 实现chatGPT的打印机效果 兼容富文本,附git地址
  • 【系统架构设计】计算机公共基础知识: 6 知识产权与标准化
  • Android ViewGroup 浅析一
  • Redis7--基础篇2(Redis的十大数据类型及常用命令)
  • freertos任务参数
  • 【计算机组成】实模式/保护模式下地址分段(基段地址+偏移地址)的原因
  • 找到【SVM】中最优的惩罚项系数C
  • Python中CAN通讯学习
  • [译]Python中的类属性与实例属性的区别
  • 「面试题」如何实现一个圣杯布局?
  • 【划重点】MySQL技术内幕:InnoDB存储引擎
  • es6
  • Facebook AccountKit 接入的坑点
  • js写一个简单的选项卡
  • leetcode46 Permutation 排列组合
  • PHP变量
  • V4L2视频输入框架概述
  • windows下mongoDB的环境配置
  • 创建一个Struts2项目maven 方式
  • 电商搜索引擎的架构设计和性能优化
  • 聊聊flink的BlobWriter
  • 日剧·日综资源集合(建议收藏)
  • 使用docker-compose进行多节点部署
  • 它承受着该等级不该有的简单, leetcode 564 寻找最近的回文数
  • 通过几道题目学习二叉搜索树
  • 微信开放平台全网发布【失败】的几点排查方法
  • 我的zsh配置, 2019最新方案
  • # Panda3d 碰撞检测系统介绍
  • #NOIP 2014#day.2 T1 无限网络发射器选址
  • $.each()与$(selector).each()
  • (13)[Xamarin.Android] 不同分辨率下的图片使用概论
  • (52)只出现一次的数字III
  • (C语言)编写程序将一个4×4的数组进行顺时针旋转90度后输出。
  • (Repost) Getting Genode with TrustZone on the i.MX
  • (带教程)商业版SEO关键词按天计费系统:关键词排名优化、代理服务、手机自适应及搭建教程
  • (二)斐波那契Fabonacci函数
  • (分布式缓存)Redis持久化
  • (附源码)springboot猪场管理系统 毕业设计 160901
  • (附源码)ssm基于jsp高校选课系统 毕业设计 291627
  • (紀錄)[ASP.NET MVC][jQuery]-2 純手工打造屬於自己的 jQuery GridView (含完整程式碼下載)...
  • (六)软件测试分工
  • (十二)python网络爬虫(理论+实战)——实战:使用BeautfulSoup解析baidu热搜新闻数据
  • ***监测系统的构建(chkrootkit )
  • .bat批处理(二):%0 %1——给批处理脚本传递参数
  • .dat文件写入byte类型数组_用Python从Abaqus导出txt、dat数据
  • .NET delegate 委托 、 Event 事件,接口回调
  • .NET DevOps 接入指南 | 1. GitLab 安装
  • .net 流——流的类型体系简单介绍