SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); SkPaint::Style style = paint.getStyle(); if (style == SkPaint::kStroke_Style) { std::cout << "The current style is kStroke_Style" << std::endl; } else { std::cout << "The current style is not kStroke_Style" << std::endl; }
SkPaint paint; SkPaint::Style style = paint.getStyle(); if (style == SkPaint::kFill_Style) { std::cout << "The current style is kFill_Style" << std::endl; } else { std::cout << "The current style is not kFill_Style" << std::endl; }In this example, we create an `SkPaint` object and call the `getStyle()` method to retrieve the current style. We then check if it matches the `kFill_Style`. Since this is the default value, the output will be "The current style is kFill_Style". Package library: Skia.