Drawable image on a canvas

后端 未结 6 1166
有刺的猬
有刺的猬 2020-11-28 22:57

How can I get an image to the canvas in order to draw on that image?

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 23:33

    also you can use this way. it will change your big drawble fit to your canvas:

    Resources res = getResources();
    Bitmap bitmap = BitmapFactory.decodeResource(res, yourDrawable);
    yourCanvas.drawBitmap(bitmap, 0, 0, yourPaint);
    

提交回复
热议问题