1
回答
android 怎么保存 Matrix 内的信息啊?
终于搞明白,存储TCO原来是这样算的>>>   

用canvas绘制图片,并用matrix对图片做出缩放/旋转等修改,现在想把修改后的matrix信息保存下来,而不是保存征战图片,请问该怎么做啊?

目前已知

Matrix matrix = new Matrix();
matrix.postScale(7, 8, 9, 10);
matrix.postRotate(11, 12, 13);
matrix.postTranslate(14, 15);
float[] values = new float[9];
matrix.getValues(values);
for (int i = 0; i < values.length; i++) {
	LogUtil.showLog("value i is " + values[i]);
}

01-03 15:33:47.179: D/example(3549): value i is 6.8713903
01-03 15:33:47.179: D/example(3549): value i is -1.526472
01-03 15:33:47.179: D/example(3549): value i is -22.950245
01-03 15:33:47.179: D/example(3549): value i is 1.335663
01-03 15:33:47.179: D/example(3549): value i is 7.8530173
01-03 15:33:47.179: D/example(3549): value i is -66.06844
01-03 15:33:47.179: D/example(3549): value i is 0.0
01-03 15:33:47.179: D/example(3549): value i is 0.0
01-03 15:33:47.179: D/example(3549): value i is 1.0

不能返回当初放进去的7\8\9\...等数据.

举报
oldfeel
发帖于4年前 1回/453阅
顶部