SkBitmap bmp; bmp.load("image.png"); SkColor color = bmp.getColor(100, 200);
SkBitmap bmp; bmp.allocN32Pixels(500, 500); bmp.eraseColor(SK_ColorWHITE); bmp.fillRect(SkRect::MakeLTRB(100, 100, 400, 400), SK_ColorBLACK); SkColor color = bmp.getColor(250, 250);In this example, we create a new SkBitmap object with dimensions 500x500 and white background. We then draw a black rectangle in the center of the bitmap and retrieve the color value of the pixel at the center point (250, 250) using the getColor() method. Library Package: Skia graphics library.