I have a custom view that is showing an image inside a shape.
I used BitmapShader
to fit my image into the shape with TileMode
is CLAMP
Now I have a problem that when I am moving my image (using setLocalMatrix
method) it make my image become terrible.
here is my image when moving around:
Here is my code:
BitmapShader shader=new BitmapShader(sbmp, TileMode.CLAMP, TileMode.CLAMP);
Matrix currMatrix = new Matrix(this.getMatrix());
currMatrix.postTranslate(currX, currY);
shader.setLocalMatrix(currMatrix);
mpaint.setShader(shader);
You can translate image with instead of localMatrix