Method Serialize
Serialize(SKBitmap?, int, int)
Encodes an SKBitmap into a BlurHash string.
public static string Serialize(SKBitmap? bitmap, int componentsX, int componentsY)
Parameters
bitmapSKBitmapThe bitmap to encode.
componentsXintThe number of horizontal components (must be in the range [2..9]).
componentsYintThe number of vertical components (must be in the range [2..9]).
Returns
- string
A BlurHash string representing the image.
Exceptions
- ArgumentNullException
bitmapisnull.- ArgumentOutOfRangeException
componentsXorcomponentsYis outside the range [2..9].
Serialize(SKImage?, int, int)
Encodes an SKImage into a BlurHash string.
public static string Serialize(SKImage? image, int componentsX, int componentsY)
Parameters
imageSKImageThe image to encode.
componentsXintThe number of horizontal components (must be in the range [2..9]).
componentsYintThe number of vertical components (must be in the range [2..9]).
Returns
- string
A BlurHash string representing the image.
Exceptions
- ArgumentNullException
imageisnull.- ArgumentOutOfRangeException
componentsXorcomponentsYis outside the range [2..9].
Serialize(SKPixmap?, int, int)
Encodes an SKPixmap into a BlurHash string.
public static string Serialize(SKPixmap? pixmap, int componentsX, int componentsY)
Parameters
pixmapSKPixmapThe pixmap to encode.
componentsXintThe number of horizontal components (must be in the range [2..9]).
componentsYintThe number of vertical components (must be in the range [2..9]).
Returns
- string
A BlurHash string representing the image.
Exceptions
- ArgumentNullException
pixmapisnull.- ArgumentOutOfRangeException
componentsXorcomponentsYis outside the range [2..9].