Вопрос

In drawing Graphics2D there are 2 ways to draw cubic curve either through GeneralPath class and using its methods beginning with moveTo and to draw curves with curveTo, but i saw also there's another way to draw it, but with another class CubicCurve2D then using its methods setCurve so, What's the difference between them ? and when we need to use them ?

Это было полезно?

Решение

CubicCurve2D is a class representing a single curve. Use it when you operate with isolated cubic curves.

Path2D (which should be used instead of legacy GeneralPath) is a class representing an arbitrary geometric path - sequence of lines, curves and moves etc. Use it when you operate with sequences of connected shapes.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top