文章标题
2016-07-28 14:02
190 查看
将一个图片中间分开,向两边退出
先创建画布
void getLeftBitmap(Bitmap srcBitmap){
Bitmap destBitmap = Bitmap.createBitmap(srcBitmap.getwidth()/2, srcBitmap.getheight(),srcBItmap.getConfig());
Matrix matrix = newe Matrix();
Paint paint = new Paint();
canvas.drawBitmap(srcBitmap, matrix,paint)}
android.view.WindowManager$BadTokenException: Unable to add window – token null is not for an application
,使用dialog上下文只能传this,不然会报这个错。
}
先创建画布
void getLeftBitmap(Bitmap srcBitmap){
Bitmap destBitmap = Bitmap.createBitmap(srcBitmap.getwidth()/2, srcBitmap.getheight(),srcBItmap.getConfig());
//创建画布 Canvas canvas = new Canvas(destBitmap); //创建画笔
Matrix matrix = newe Matrix();
Paint paint = new Paint();
canvas.drawBitmap(srcBitmap, matrix,paint)}
android.view.WindowManager$BadTokenException: Unable to add window – token null is not for an application
,使用dialog上下文只能传this,不然会报这个错。
}
相关文章推荐
- MFC通过txt查找文件并进行复制-备忘
- 综合日语第一册动词复习
- PAT1084
- NKOI 3728 彩虹小马与魔法数列
- 今天开始重新更新(ps:广接各种php相关的外包项目,有意者请留言或者私聊)
- A - Red and Black POJ 1979
- 使用T-Code:ST05 追踪
- 线程、线程句柄、线程ID
- jQuery插件开发详细教程
- 2015最流行的Android组件、工具、框架大全
- 超好的Git学习网站
- HTML+CSS基础课程(三)
- linux常用命令之关机重启命令
- 如何解决Sharepoint Digest 超时问题
- 二叉树的镜像 C++
- C语言的类型,字节,还有转义字符0728
- 商品添加购物车实现动画效果
- Tomcat启动内存设置
- 题号未知 , Array Queries 【RMQ】
- apk反编译xml文件