I have a Bitmap object in my main class. I need to send this bitmap to my custom view class in order to set it as a background for further processing on the canvas.
For example, there is a method called setPicture that takes a bitmap as a parameter. So, how can I draw this bitmap on canvas?
See code below:
public class TouchView extends View { final int MIN_WIDTH = 75; final int MIN_HEIGHT = 75; final int DEFAULT_COLOR = Color.RED; int _color; final int STROKE_WIDTH = 2; private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); private float x, y; private boolean touching = false; public TouchView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle);
}
How to send this bitmap to onDraw?
source share