SKShader.CreateBitmap Method

Definition

Overloads

CreateBitmap(SKBitmap)

Creates a new shader that will draw with the specified bitmap.

CreateBitmap(SKBitmap, SKShaderTileMode, SKShaderTileMode)

Creates a new shader that will draw with the specified bitmap.

CreateBitmap(SKBitmap, SKShaderTileMode, SKShaderTileMode, SKMatrix)

Creates a new shader that will draw with the specified bitmap.

CreateBitmap(SKBitmap)

Creates a new shader that will draw with the specified bitmap.

public static SkiaSharp.SKShader CreateBitmap (SkiaSharp.SKBitmap src);

Parameters

src
SKBitmap

The bitmap to use inside the shader.

Returns

Returns a new SKShader, or an empty shader on error. This function never returns null.

Remarks

If the bitmap cannot be used (has no pixels, or its dimensions exceed implementation limits) then an empty shader may be returned. If the source bitmap's color type is Alpha8 then that mask will be colorized using the color on the paint.

Applies to

CreateBitmap(SKBitmap, SKShaderTileMode, SKShaderTileMode)

Creates a new shader that will draw with the specified bitmap.

public static SkiaSharp.SKShader CreateBitmap (SkiaSharp.SKBitmap src, SkiaSharp.SKShaderTileMode tmx, SkiaSharp.SKShaderTileMode tmy);

Parameters

src
SKBitmap

The bitmap to use inside the shader.

tmx
SKShaderTileMode

The tiling mode to use when sampling the bitmap in the x-direction.

tmy
SKShaderTileMode

The tiling mode to use when sampling the bitmap in the y-direction.

Returns

Returns a new SKShader, or an empty shader on error. This function never returns null.

Remarks

If the bitmap cannot be used (has no pixels, or its dimensions exceed implementation limits) then an empty shader may be returned. If the source bitmap's color type is Alpha8 then that mask will be colorized using the color on the paint.

Applies to

CreateBitmap(SKBitmap, SKShaderTileMode, SKShaderTileMode, SKMatrix)

Creates a new shader that will draw with the specified bitmap.

public static SkiaSharp.SKShader CreateBitmap (SkiaSharp.SKBitmap src, SkiaSharp.SKShaderTileMode tmx, SkiaSharp.SKShaderTileMode tmy, SkiaSharp.SKMatrix localMatrix);

Parameters

src
SKBitmap

The bitmap to use inside the shader.

tmx
SKShaderTileMode

The tiling mode to use when sampling the bitmap in the x-direction.

tmy
SKShaderTileMode

The tiling mode to use when sampling the bitmap in the y-direction.

localMatrix
SKMatrix

The matrix to apply before applying the shader.

Returns

Returns a new SKShader, or an empty shader on error. This function never returns null.

Remarks

If the bitmap cannot be used (has no pixels, or its dimensions exceed implementation limits) then an empty shader may be returned. If the source bitmap's color type is Alpha8 then that mask will be colorized using the color on the paint.

Applies to