SkBitmap bmp1, bmp2; int width = 100, height = 100; bmp1.allocN32Pixels(width, height); bmp2.allocN32Pixels(width, height); // Copy the contents of bmp1 to bmp2 bmp1.copyTo(&bmp2);
SkBitmap bmp1, bmp2; int width = 100, height = 100; bmp1.allocN32Pixels(width, height); bmp2.allocN32Pixels(width/2, height/2); // Scale and copy the contents of bmp1 to bmp2 bmp1.copyTo(&bmp2, SkIRect::MakeWH(width/2, height/2));In this example, bmp1 and bmp2 are created with different sizes. The contents of bmp1 are scaled down and copied to bmp2 using the copyTo() function and a rectangle specifying the area of bmp2 to copy to. Package Library: Skia Graphics Library