'rect'에 해당되는 글 1건

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
 
  1. CustomView의 생성과정은 점,선,면의 생성과정과 동일하다
  2. Sample ( Canvas에 출력하기 / Canvas에 궤적추적출력 활용 )
  3. Path는 drawPath, drawTextOnPath와 같이 궤적을 따라 출력하기 위한 객체이다
  4. 벡터정보를 저장하고 궤적을 출력하는등 활용도가 다양하다
  5. 관련 메서드
    1. void addArc(RectF oval, float startAngle, float sweepAngle) : 호의 추가
    2. void addCircle(float x, float y, float radius, Path.Direction dir) : 원의 추가
    3. void addOval(RectF oval, Path.Direction dir)  : 타원의 추가
    4. void addPath(Path src, Matrix matrix) : 행렬이 적용되는 Path의 추가
      1. (Path src)
      2. (Path src, float dx, float dy)
    5. void addRect(RectF rect, Path.Direction dir) : 사각형 추가
      1. (float left, float top, float right, float bottom, Path.Direction dir)
    6. void addRoundRect(RectF rect, float[] radii, Path.Direction dir) :모따진 사각형추가
      1. (RectF rect, float rx, float ry, Path.Direction dir)
    7. void arcTo(RectF oval, float startAngle, float sweepAngle, boolean forceMoveTo)  : 호의 추가
      1. (RectF oval, float startAngle, float sweepAngle)
    8. void close() : 현 궤적의 종료
    9. void computeBounds(RectF bounds, boolean exact) : Path point의 영역산출
    10. void cubicTo(float x1, float y1, float x2, float y2, float x3, float y3) : 베지어 공식의 곡선  
      1. rCubicTo(float x1, float y1, float x2, float y2, float x3, float y3) : 상대좌표사용       
    11. Path.FillType getFillType()  : 현 Path 채우기모드의 반환
    12. void incReserve(int extraPtCount) : Hint to the path to prepare for adding more points.
    13. boolean isEmpty() : 정보가 없는 경우 true를 반환
    14. boolean isInverseFillType()  : 반대변형이 가능한가를 판단
    15. boolean isRect(RectF rect) : 영역의 정보가 사각형인가를 판단
    16. void lineTo(float x, float y) : 마지막 Path에서 선그리기 추가
      1. rLineTo(float dx, float dy)  : 상대좌표 사용
    17. void moveTo(float x, float y) : 좌표이동 추가
      1. rMoveTo(float dx, float dy) : 상대좌표사용
    18. void offset(float dx, float dy) : Offset the path by (dx,dy), returning true on success
      1. (float dx, float dy, Path dst)
    19. void quadTo(float x1, float y1, float x2, float y2)  :
      1. Add a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2).
      2. rQuadTo(float dx1, float dy1, float dx2, float dy2) : 상대좌표사용
    20. void reset() : Path정보를 Empty로 만들기
    21. void rewind() : 라인, 커브는 지우고, 내부정보는 다시 사용하는 방법
    22. void set(Path src) : 정보의 수정
    23. void setFillType(Path.FillType ft) : 채우기 지정
    24. void setLastPoint(float dx, float dy) : 최종좌표의 변경
    25. void toggleInverseFillType() : 채우기의 반대모드로 변환하기
    26. void transform(Matrix matrix) : 행렬로 변형하기
      1. transform(Matrix matrix, Path dst)
  6. 사용 순서
    1. public void onDraw(Canvas canvas)에서 사용
      1. Path path = new Path();
      2. Paint paint = new Paint(); // Path출력도 Paint의 정보에 준한다
      3. paint정보 Setting 하기
      4. path정보 만들기
      5. canvas.drawPath( path, paint ) // Path 출력하기
        1. canvas.drawTextOnPath( string, path, 0, 0, paint) // 곡선, 원등에 문자출력하기
블로그 이미지

By훈트

,