harmony 鸿蒙drawing_bitmap.h

  • 2025-06-12
  • 浏览 (4)

drawing_bitmap.h

Overview

The drawing_bitmap.h declares the functions related to the bitmap in the drawing module.

File to include: <native_drawing/drawing_bitmap.h>

Library: libnative_drawing.so

Since: 8

Related module: Drawing

Summary

Structs

Name Description
struct OH_Drawing_BitmapFormat Describes the pixel format of a bitmap, including the color type and alpha type.

Types

Name Description
typedef struct OH_Drawing_BitmapFormat OH_Drawing_BitmapFormat Defines a struct for the pixel format of a bitmap, including the color type and alpha type.

Functions

Name Description
OH_Drawing_Bitmap * OH_Drawing_BitmapCreate (void) Creates an OH_Drawing_Bitmap object.
void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap *) Destroys an OH_Drawing_Bitmap object and reclaims the memory occupied by the object.
OH_Drawing_Bitmap * OH_Drawing_BitmapCreateFromPixels (OH_Drawing_Image_Info *, void *pixels, uint32_t rowBytes) Creates an OH_Drawing_Bitmap object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for.
void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap *, const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat *) Initializes the width and height of a bitmap and sets the pixel format for the bitmap.
uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap *) Obtains the width of a bitmap.
uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap *) Obtains the height of a bitmap.
OH_Drawing_ColorFormat OH_Drawing_BitmapGetColorFormat (OH_Drawing_Bitmap *) Obtains the pixel format of a bitmap.
OH_Drawing_AlphaFormat OH_Drawing_BitmapGetAlphaFormat (OH_Drawing_Bitmap *) Obtains the alpha component of a bitmap.
void * OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap *) Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.
void OH_Drawing_BitmapGetImageInfo (OH_Drawing_Bitmap *, OH_Drawing_Image_Info *) Obtains the image information of a bitmap.
bool OH_Drawing_BitmapReadPixels (OH_Drawing_Bitmap *, const OH_Drawing_Image_Info *dstInfo, void *dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY) Reads pixels of the rectangle in a bitmap to the specified buffer.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkGraphics 2D

harmony 鸿蒙BufferHandle

harmony 鸿蒙ColorSpacePrimaries

harmony 鸿蒙DisplaySoloist_ExpectedRateRange

harmony 鸿蒙_drawing

harmony 鸿蒙NativeColorSpaceManager

harmony 鸿蒙NativeDisplaySoloist

harmony 鸿蒙NativeVsync

harmony 鸿蒙NativeWindow

harmony 鸿蒙OH_Drawing_BitmapFormat

0  赞