获得徽章 0
赞了这篇文章
赞了这篇文章
大佬们 为啥这段代码有时候画出来的图是黑屏的啊
/*******1********/
Bitmap outBitmap = Bitmap.createBitmap(cardW, cardH, Bitmap.Config.RGB_565);
// 利用bitmap生成画布
Canvas frontCanvas = new Canvas(outBitmap);
// 把view中的内容绘制在画布上
playball_sc.draw(frontCanvas);
//总的画布
Bitmap contentBitmap = Bitmap.createBitmap(cardW, totalH, Bitmap.Config.RGB_565);
Canvas contentCanvas = new Canvas(contentBitmap);
int card2H = topH + margin;
contentCanvas.drawColor(mContext.getResources().getColor(R.color.baseBgDarker));
contentCanvas.drawBitmap(outBitmap, 0, card2H, null);
/*******1********/
Bitmap outBitmap = Bitmap.createBitmap(cardW, cardH, Bitmap.Config.RGB_565);
// 利用bitmap生成画布
Canvas frontCanvas = new Canvas(outBitmap);
// 把view中的内容绘制在画布上
playball_sc.draw(frontCanvas);
//总的画布
Bitmap contentBitmap = Bitmap.createBitmap(cardW, totalH, Bitmap.Config.RGB_565);
Canvas contentCanvas = new Canvas(contentBitmap);
int card2H = topH + margin;
contentCanvas.drawColor(mContext.getResources().getColor(R.color.baseBgDarker));
contentCanvas.drawBitmap(outBitmap, 0, card2H, null);
展开
评论
2
![[流泪]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_6.dde0d83.png)