#include// Create SkPath object SkPath path; // Add an oval shape to the path path.addOval(SkRect::MakeLTRB(50, 50, 100, 200)); // Use the SkPath object in other functions to draw the oval graphics->drawPath(path, paint);
#includeIn this example, a SkPath object is created and an oval shape is added with the addOval method. The oval is defined by the SkRect::MakeLTRB method, which creates a rectangle as before. However, this time the SkPathDirection parameter is set to kCCW, which changes the direction of the oval. The path is then transformed using the SkMatrix::MakeRotate method to rotate the oval by 45 degrees. The SkPath object can then be used in other functions, such as graphics->drawPath, to draw the rotated oval shape. Package library: Skia.// Create SkPath object SkPath path; // Add an oval shape to the path with rotation path.addOval(SkRect::MakeLTRB(50, 50, 100, 200), SkPathDirection::kCCW); path.transform(SkMatrix::MakeRotate(45)); // Use the SkPath object in other functions to draw the rotated oval graphics->drawPath(path, paint);