SkMatrix matrix; matrix.setScale(2.0, 4.0); float scaleY = matrix.getScaleY(); // scaleY is now equal to 4.0
SkMatrix matrix; matrix.setRotate(45.0); matrix.postScale(1.0, 3.0); float scaleY = matrix.getScaleY(); // scaleY is now equal to 3.0This example creates an SkMatrix and sets it to a 45-degree rotation using the setRotate member function. It then applies a scaling transformation that scales the Y-axis by a factor of 3.0 using the postScale member function. Finally, the code retrieves the scaling factor of the Y-axis using getScaleY and assigns it to the variable scaleY. Package Library: SkMatrix is a part of Skia graphics engine. It is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms.