столкнулся с такой проблемой: есть в drawable imge.jpg , делаю в классе
Код: Выделить всё
class MClass extends View{
public void fun(){
Bitmap bm1 = BitmapFactory.decodeResource(getContext().getResources(R.drawable.plastic);
Bitmap bm2 = Bitmap.createBitmap(bm1.getWidth(),bm1.getHeight(),bm1.getConfig());
}
}
Код: Выделить всё
@Override
protected void onDraw(Canvas canvas){
canvas.drawBitmap(bm2, 0, 0, null);
}