1

I have troubles converting a 6 values SVG matrix to an Android Matrix. The SVG matrix looks like this : {SCALE_X, SKEW_X, SKEW_Y, SCALE_Y, OFFSET_X, OFFSET_Y }

I've tried something like this but no result:

Matrix t_matrix = new Matrix();
t_matrix.setScale(SVG[0], SVG[3]);
t_matrix.setSkew(SVG[1], SVG[2]);
t_matrix.setTranslate(SVG[4], SVG[5]);
float[] f_t_matrix = {1, 0, 0,0,1,0,0,0,1} ;
t_matrix.mapPoints(f_t_matrix);

Data stored in f_t_matrix are inconsistent with real data. For example for a SVG matrix like : 1,0,0,1,448.2275,110.54 the Android Matrix is [449.2275, 110.54, 448.2275, 110.54, 449.2275, 110.54, 448.2275, 110.54, 1.0] . What may be the problem ?

Regards.

4

1 回答 1

0

会是这样

Matrix t_matrix = new Matrix();
t_matrix.setScale(SVG[0], SVG[4]);
t_matrix.setSkew(SVG[1], SVG[3]);
t_matrix.setTranslate(SVG[2], SVG[5]);
于 2013-02-02T09:44:47.373 回答