我正在尝试在ImageView
. 我试过了,canvas.drawBitmap()
但似乎显示了图像的错误部分。我的代码:
主要活动:
this.drawCharacter = new DrawCharacter(1);
this.bm = Bitmap.createBitmap(16, 32, Bitmap.Config.ARGB_8888);
this.c = new Canvas(this.bm);
this.c = this.drawCharacter.drawCharacter(this.c, this.characterBitmap);
this.bm = Bitmap.createScaledBitmap(this.bm, this.imgWidth, this.imgHeight, isChild());
this.imgv.setImageBitmap(this.bm);
绘制字符:
[...]
Paint localPaint = new Paint();
paramCanvas.drawBitmap(paramBitmap, new Rect(8, 8, 16, 16), new Rect(4, 0, 12, 8), localPaint);
return paramCanvas;
[...]
最后显示了图像的一些奇怪部分。