|
안드로이드 설치 및 개발 |
[1] |
|
등록일:2018-10-15 18:09:55 (0%) 작성자: 제목:canvas에 그림 그려서 imageview에 붙이기 |
|
출처: 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));
|
[본문링크] canvas에 그림 그려서 imageview에 붙이기
|
[1]
|
|
|
|
|
코멘트(이글의 트랙백 주소:/cafe/tb_receive.php?no=34874 |
|
|
|
|
|
|
|
|
|
Copyright byCopyright ⓒ2005, SSISO Community All Rights Reserved.
|
|
|