java.awt.Rectangle.getPathIterator()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中java.awt.Rectangle.getPathIterator方法的一些代码示例,展示了Rectangle.getPathIterator的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.getPathIterator方法的具体详情如下:
包路径:java.awt.Rectangle
类名称:Rectangle
方法名:getPathIterator

Rectangle.getPathIterator介绍

暂无

代码示例

代码示例来源:origin: threerings/nenya

public PathIterator getPathIterator (AffineTransform at)
{
  return _bounds.getPathIterator(at);
}

代码示例来源:origin: com.threerings/nenya

public PathIterator getPathIterator (AffineTransform at)
{
  return _bounds.getPathIterator(at);
}

代码示例来源:origin: com.threerings/nenya

public PathIterator getPathIterator (AffineTransform at, double flatness)
{
  return _bounds.getPathIterator(at, flatness);
}

代码示例来源:origin: threerings/nenya

public PathIterator getPathIterator (AffineTransform at, double flatness)
{
  return _bounds.getPathIterator(at, flatness);
}

代码示例来源:origin: stackoverflow.com

public class TestRotate {
  public static void main(String... args) {

    Rectangle r = new Rectangle(50, 50, 100, 100);
    Point check = new Point(100, 151); // clearly outside

    System.out.println("first: " + r.contains(check));

    AffineTransform at = AffineTransform.getRotateInstance(
        Math.PI/4, r.getCenterX(), r.getCenterY());

    Polygon p = new Polygon(); 

    PathIterator i = r.getPathIterator(at);
    while (!i.isDone()) {
      double[] xy = new double[2];
      i.currentSegment(xy);
      p.addPoint((int) xy[0], (int) xy[1]);
      System.out.println(Arrays.toString(xy));

      i.next();
    }

    // should now be inside :)
    System.out.println("second: " + p.contains(check));
  }
}

代码示例来源:origin: stackoverflow.com

AffineTransform at = new AffineTransform();
at.rotate(Math.toRadians(angle), box.x + (box.width / 2), box.y + (box.height / 2));
PathIterator pi = box.getPathIterator(at);
Path2D path = new Path2D.Float();
path.append(pi, true);

相关文章