Skip to main content

OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix

Function OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix 

Source
pub unsafe extern "C" fn OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(
    startPt: *const OH_Drawing_Point2D,
    endPt: *const OH_Drawing_Point2D,
    colors: *const u32,
    pos: *const f32,
    size: u32,
    tileMode: OH_Drawing_TileMode,
    matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect
Expand description

@brief Creates an OH_Drawing_ShaderEffect that generates a linear gradient between the two specified points.

@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing @param startPt Indicates the start point for the gradient. @param endPt Indicates the end point for the gradient. @param colors Indicates the colors to be distributed between the two points. @param pos Indicates the relative position of each corresponding color in the colors array. If pos is nullptr, the colors are evenly distributed between the start and end point. @param size Indicates the number of colors and pos(if pos is not nullptr). @param tileMode Indicates the tile mode. @param matrix Indicates the pointer to an OH_Drawing_Matrix object, which represents the local matrix of the created OH_Drawing_ShaderEffect object. If matrix is nullptr, defaults to the identity matrix. @return Returns the pointer to the OH_Drawing_ShaderEffect object created. If nullptr is returned, the creation fails. The possible cause of the failure is any of startPt, endPt, colors and pos is nullptr. @since 12 @version 1.0