以下是我的程式:
importClass(org.apache.batik.parser.PointsHandler);
importClass(org.apache.batik.parser.PointsParser);
var pp = new PointsParser();
var ph = new PointsHandler({point: function(x, y) {print('('+ x + ',' + y + ')');}});
pp.setPointsHandler(ph);
測試一下:
pp.parse('50,375,150,375 150,325 250,325 250,375,350,375 350,250 450,250 450,375,550,375 550,175 650,175 650,375,750,375 750,100, 850,100 850,375, 50,375 950,25 1050,25 1050,375,1150,375');
沒有留言:
張貼留言