SkBitmap is a C++ class that allows for the creation, manipulation and rendering of bitmap images. The method allocN32Pixels() is used to allocate memory for an image in 32-bit format.
Example 1: This example shows how to allocate memory for a bitmap with a width of 800 pixels and a height of 600 pixels.
SkBitmap bmp; bmp.allocN32Pixels(800, 600);
Example 2: This example shows how to allocate memory for a bitmap with a width of 1024 pixels and a height of 768 pixels, using the SkImageInfo class to specify the color space and alpha type.
SkImageInfo info = SkImageInfo::Make(1024, 768, kN32_SkColorType, kPremul_SkAlphaType); SkBitmap bmp; bmp.allocPixels(info);
Package library: Skia Graphics Library.
C++ (Cpp) SkBitmap::allocN32Pixels - 30 examples found. These are the top rated real world C++ (Cpp) examples of SkBitmap::allocN32Pixels extracted from open source projects. You can rate examples to help us improve the quality of examples.