当前位置:网站首页>用控件当画笔获得bitmap代码记录
用控件当画笔获得bitmap代码记录
2022-08-01 04:59:00 【痕迹丶】
int width = 1000;
int height = 1000;
TextView textView = new TextView(context);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
textView.setText(“123”);
textView.setBackgroundColor(Color.YELLOW);
textView.setGravity(Gravity.CENTER);
textView.layout(0, 0, width, height);
textView.measure(View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY));
textView.draw(canvas);
边栏推荐
猜你喜欢
pytroch、tensorflow对比学习—专栏介绍
typescript19-对象可选参数
万字逐行解析与实现Transformer,并进行德译英实战(一)
MySQL-数据定义语言-DDLdatebase define language
API Design Notes: The pimpl trick
mysql中解决存储过程表名通过变量传递的方法
(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)
typescript28-枚举类型的值以及数据枚举
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
USB3.0:VL817Q7-C0的LAYOUT指南(二)
随机推荐
Asynchronous reading and writing of files
Logitech Mouse Experience Record
RSA主要攻击方法
在沈自所的半年总结
状态压缩dp
请问shake数据库中想把源的db0的数据同步到目的db5,参数怎么设置呢?
II. Binary tree to Offer 68 - recent common ancestor
pytroch、tensorflow对比学习—搭建模型范式(低阶、中阶、高阶API示例)
typescript28-枚举类型的值以及数据枚举
[MySQL] 多表查询
y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
state compressed dp
剑指 Offer 68 - II. 二叉树的最近公共祖先
LeetCode 27. 移除元素
typescript25-类型断言
UE4 rays flashed from mouse position detection
今日睡眠质量记录68分
typescript25 - type assertion
UE4 制作遇到的问题
pytorch、tensorflow对比学习—张量