当前位置:网站首页>用控件当画笔获得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);
边栏推荐
- 怀念故乡的面条
- 文件的异步读写
- USB3.0:VL817Q7-C0的LAYOUT指南(三)
- Excel做题记录——整数规划优化模型
- 万字逐行解析与实现Transformer,并进行德译英实战(三)
- ModuleNotFoundError: No module named 'tensorflow.keras' error message solution
- Swastika line-by-line parsing and realization of the Transformer, and German translation practice (2)
- 今日睡眠质量记录68分
- SQL Analysis of ShardingSphere
- 罗技鼠标体验记录
猜你喜欢
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
Excel record of integer programming optimization model to solve the problem
Pyspark机器学习:向量及其常用操作
pytroch、tensorflow对比学习—搭建模型范式(低阶、中阶、高阶API示例)
USB3.0:VL817Q7-C0的LAYOUT指南(二)
The difference between scheduleWithFixedDelay and scheduleAtFixedRate
Power button (LeetCode) 212. The word search II (2022.07.31)
怀念故乡的面条
7 行代码搞崩溃 B 站,原因令人唏嘘!
typescript25 - type assertion
随机推荐
The Principle Of Percona Toolkit Nibble Algorithm
2022年超全的Android面经(附含面试题|进阶资料)
y83. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (14)
在互联网时代,有诸多「互联网+」模式的诞生
7月编程排行榜来啦!这次有何新变化?
(2022牛客多校四)A-Task Computing (排序+动态规划)
PMP 项目沟通管理
Typescript20 - interface
The difference between scheduleWithFixedDelay and scheduleAtFixedRate
typescript21 - Comparison of Interfaces and Type Aliases
4D line-by-line analysis and implementation of Transformer, and German translation into English (3)
怀念故乡的面条
25. Have you been asked these three common interview questions?
文件的异步读写
风险策略调优中重要的三步分析法
Mysql基础篇(Mysql数据类型)
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
(Codeforce 757)E. Bash Plays with Functions(积性函数)