반응형

출처: http://joerg-richter.fuyosoft.com/?p=120



 Bitmap  bitmap2 = BitmapFactory.decodeResource(getResources(), R.drawable.close);
		            	
  	
		            	  
⁄⁄Create a new image bitmap and attach a brand new canvas to it
Bitmap tempBitmap = Bitmap.createBitmap(bitmap2.getWidth(), bitmap2.getHeight(), Bitmap.Config.RGB_565);
            	  
Canvas canvas = new Canvas(tempBitmap);
            	  
⁄⁄Draw the image bitmap into the cavas
canvas.drawBitmap(bitmap2, 0, 0, null);

 ⁄⁄Draw everything else you want into the canvas, in this example a rectangle with rounded edges
  Paint paint = new Paint();
  paint.setTextSize(100);
  paint.setColor(0xFFFF0000);
  canvas.drawText("hhhhhhhhhhhhhhhhhhi", 300, 300, paint);
		            	  
 ⁄⁄Attach the canvas to the ImageView
  image.setImageDrawable(new BitmapDrawable(getResources(), tempBitmap));

반응형

문제 발생시 지나치지 마시고 댓글 남겨주시면 가능한 빨리 답장드립니다.

도움이 되셨다면 토스아이디로 후원해주세요.
https://toss.me/momo2024


제가 쓴 책도 한번 검토해보세요 ^^

+ Recent posts