SkBitmap bitmap; bitmap.setConfig(SkBitmap::Config::kARGB_8888, 640, 480); bitmap.allocPixels(); bitmap.eraseColor(SK_ColorWHITE);
SkBitmap bitmap; bitmap.setConfig(SkBitmap::Config::kARGB_8888, 640, 480); bitmap.allocPixels(); bitmap.eraseColor(SK_ColorTRANSPARENT);In this example, the bitmap is once again created with a configuration of kARGB_8888 and a size of 640x480 pixels. The allocPixels function is called to allocate memory for the bitmap. Finally, eraseColor is used to set the bitmap to transparent. The SkBitmap library is part of the Skia graphics engine, which is a cross-platform library for 2D graphics commonly used in mobile and web applications.