我目前正在使用圖形和路徑,我可以成功地顯示任何我想要的。安卓繪製動畫線
但不是直接在我的SurfaceView上繪製直線,我想在動畫中逐漸繪製它。
到目前爲止我所做的是創建一個Path,然後使用PathMeasure逐步檢索路徑上的座標。這裏基本上是我迄今爲止所做的
PathMeasure pm = new PathMeasure(myPath, false);
float position = 0;
float end = pm.getLength();
float[] coord = {0,0,0,0,0,0,0,0,0};
while (position < end){
Matrix m = new Matrix();
// put the current path position coordinates into the matrix
pm.getMatrix(position, m, PathMeasure.POSITION_MATRIX_FLAG | PathMeasure.TANGENT_MATRIX_FLAG);
// put the matrix data into the coord array (coord[2] = x and coord[5] = y)
m.getValues(coord);
????
position += 1;
}
問號是我被卡住的地方。我想逐步繪製路徑並在屏幕上看到它的動畫。我在網上找不到關於它的很多信息,所以如果你已經遇到過相同的情況,任何線索都會非常感激。我想創建的最終效果就像鉛筆逐漸自動地繪製文本。
沒有答案!沒有人曾經使用過Path和android圖形包? – Sasuke 2011-03-23 08:22:30
嘿sasuke米卡住了同樣的問題,你找到任何解決方案? – dharan 2011-08-09 09:37:00