SkBitmap bitmap; // Load bitmap from file or create it int x = 10; int y = 20; // Get a pointer to the pixel at position (x,y) uint32_t* pixel = bitmap.getAddr(x,y); // Set the pixel color to red *pixel = SkColorSetRGB(255, 0, 0);
SkBitmap bitmap; // Load bitmap from file or create it int width = bitmap.width(); int height = bitmap.height(); for(int y=0; yIn this example, we iterate over all pixels in a bitmap and set them to white. This code shows how to use SkBitmap getAddr() to modify multiple pixels in a bitmap. Based on the function and the examples, SkBitmap is part of the Skia Graphics Library.