SkPaint reset() is a function in the Skia Graphics Library for C++. Skia is an open source 2D graphics library that provides common APIs for several platforms, including Android, macOS, Windows, and Linux. The SkPaint class is part of the Skia Library and is used for defining and drawing basic shapes and text.
Description: SkPaint reset() is a method of the SkPaint class that resets the paint object to its default state. This means that all the attributes of the paint object, such as the color, style, stroke width, and text size, are set to their default values.
Code example: Here is a code example that demonstrates how to use the reset() method to reset a SkPaint object to its default state:
#include "SkPaint.h"
int main() { SkPaint paint;
// Set some attributes of the paint object paint.setColor(SkColorSetARGB(255, 0, 0, 255)); paint.setStrokeWidth(5.0f);
// Reset the paint object to its default state paint.reset();
// Verify that the paint object has been reset assert(paint.getColor() == SK_ColorBLACK); assert(paint.getStrokeWidth() == 1.0f);
return 0; }
In this example, we create a SkPaint object called paint and set some of its attributes using the setColor() and setStrokeWidth() methods. Then we call the reset() method to reset the paint object to its default state. Finally, we use the assert() function to verify that the color and stroke width of the paint object have been reset to their default values.
Package Library: Skia is a C++ library that is often used as part of a larger software package or framework. For example, Skia is used as the graphics rendering engine in the Google Chrome web browser and the Flutter mobile app development framework. Therefore, the package library for Skia depends on the specific platform or framework in which it is used.
C++ (Cpp) SkPaint::reset - 22 examples found. These are the top rated real world C++ (Cpp) examples of SkPaint::reset extracted from open source projects. You can rate examples to help us improve the quality of examples.