文章标题

来源:互联网 发布:女朋友说我不懂她 知乎 编辑:程序博客网 时间:2024/04/30 22:55

将一个图片中间分开,向两边退出
先创建画布

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,不然会报这个错。
}

0 0
原创粉丝点击