• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps apply matrix from one imageview to another image view with a bigger size bitmap

luffyduno

Lurker
i have 2 image views with same size, the first imageview have bitmap with 600 px size second image view have 1024 px bitmap , and i am scaling rotating and moving first image view with matrix , once the user hit a button second image view should have the same size scale and rotation, but because the second imageview have a bigger bitmap i cannot just use

imageview2.setimagematrix(ImageView1Matrix)

it gives different results, is there anyway i can apply same operations(resize,rotate , translate) on the second imageview frim the first image view matrix, i tried the follwings but only translate working, scale is not working and i don't know where to start to get the rotation value

float[] values = new float[9];
MIV1.getValues(values);

Matrix a=new Matrix();
a.setTranslate(values[Matrix.MTRANS_X], values[Matrix.MTRANS_Y]);
*/
RectF r = new RectF();
MIV1.mapRect(r);

RectF drawableRect = new RectF(0, 0, 1024, 1024);

a.setRectToRect(drawableRect, r, Matrix.ScaleToFit.CENTER);
IV2.setImageMatrix(a);
 
Back
Top Bottom