したがって、scanLine
を実装するメソッドを呼び出す必要があります。これは、ポイントのrasterImage List <Point2D.Double>をリストに変換する<Point>
もう一つの方法は、Point2D.Double
のリストを返します
- パラメータに3つの引数を取ります。私は新しいリストに戻り値を渡します
ArrayList<Point2D.Double> outPolygon = clip.clipPolygon(cPoints, clipper);
は、今私は
scanLine
のパラメータとしてoutPolygon
リストを使用する必要があります。しかし、Point
のリストが必要で、Point2D.Double
のリストを渡しているので、Wrong argument type
が出てきます。どのように変換するのですか?
scanLine
の引数として渡すことはできますか?私はこれを試してみました:
// prevedení z PointDouble na PointInt for(int i=0; i<outPolygon.size(); i++) { int x = (int)(outPolygon.get(i).x *(img.getWidth() - 1)); int y = (int)((1 - outPolygon.get(i).y) * (img.getHeight() - 1)); // uložení bodu do nového seznamu pointsInInteger.add(new Point(x,y)); }
とあなたは何を試してみましたか? –
@OliverCharlesworth私はこの試み: '//převedeníZ PointDouble NA PointInt \t \t \t \t \tため\t \t \t \tを(INT i = 0; iはoutPolygon.sizeを()<; iは++){ \t \t \t \t \t \t \t \t \t \t int x =(int)(outPolygon.get(i).x *(img.getWidth() - 1)); \t \t \t \t \t \t \t \t \t \t int型のY =(INT)((1 - outPolygon.get(I)・Y)*(img.getHeight() - 1))。 \t \t \t \t \t \t \t \t \t \t //uloženíボドゥDOnovéhoseznamu \t \t \t \t \t \t \t \t \t \t pointsInInteger.add(新たな点(x、y))。 \t \t \t \t \t \t \t \t \t} ' – strazak