Ii , , , :
Canvas c = new Canvas();
Bitmap bmp = BitmapFactory.decodeResource(this, R.drawable.mybasebmp);
Bitmap bmpm = bmp.copy(bmp.getConfig(), true);
Bitmap bmpt = BitmapFactory.decodeResource(this, R.drawable.mytilebmp);
c.setBitmap(bmp);
Rect r = Rect(100,100,149, 149);
c.drawBitmap(bmpt, null, r, null);
r.set(150,170, 150+50-1, 170+50-1);
c.drawBitmap(bmpt, null,r, null);
ImageView iv = (ImageView) findViewById(R.id.myimageview);
iv.setImageBitmap(bmpm);
We use the canvas to complete the entire drawing in a mutable BMP, and then we put that BMP in a visible container, like an image.
Hope this helps someone, I could not find a suitable tutorial for this.
source
share