#include "SkRect.h" SkRect rect = SkRect::MakeXYWH(10, 10, 50, 50); SkRect rectOutset = rect.outset(5, 5); // create new outer rectangle that is 5 pixels wider and taller
#include "SkRect.h" SkRect rect = SkRect::MakeXYWH(10, 10, 50, 50); SkRect rectOutset = rect.outset(-5, -5); // create new inner rectangle that is 5 pixels narrower and shorterIn this example, a rectangle is created with the 'MakeXYWH' function and then outset by -5 pixels on all sides. This creates a new rectangle that is narrower and shorter than the original. Package library: Skia Graphics Library for C++.