我有一组n
点,我想n-sided
用这些点绘制一个多边形。
我尝试使用 android.graphics.path (请参见下文)。
Path path = new Path();
Vertex currVtx;
for (int j = 0; j < vertices.size(); j++) {
currVtx = vertices.get(j);
if (!currVtx.hasLatLong())
continue;
Point currentScreenPoint = getScreenPointFromGeoPoint(
currVtx, mapview);
if (j == 0)
path.moveTo(currentScreenPoint.x, currentScreenPoint.y);
// vertex.
else
path.lineTo(currentScreenPoint.x, currentScreenPoint.y);
}
目前,我正在使用此代码获得一个实心(填充画布颜色)多边形。有没有办法可以得到一个未填充的多边形。有一个替代方案android.graphics.Path
谢谢。