SKImage Class

Definition

An abstraction for drawing a rectangle of pixels.

public class SKImage : SkiaSharp.SKObject
Inheritance

Remarks

An image is an abstraction of pixels, though the particular type of image could be actually storing its data on the GPU, or as drawing commands (picture or PDF or otherwise), ready to be played back into another canvas.

The content of an image is always immutable, though the actual storage may change, if for example that image can be recreated via encoded data or other means.

An image always has a non-zero dimensions. If there is a request to create a new image, either directly or via a surface, and either of the requested dimensions are zero, then null will be returned.

Properties

AlphaType

Gets the configured SKAlphaType for the bitmap.

ColorSpace

Gets the image color space.

ColorType

Gets the image color type.

EncodedData

Gets the encoded image pixels as a SKData, if the image was created from supported encoded stream format.

Handle

Gets or sets the handle to the underlying native object.

(Inherited from SKObject)
Height

Gets the image height.

IsAlphaOnly

Gets a value indicating whether the image will be drawn as a mask, with no intrinsic color of its own

IsLazyGenerated

Gets a value indicating whether the image is backed by an image-generator or other source that creates (and caches) its pixels / texture on-demand.

IsTextureBacked

Gets a value indicating whether the image is texture backed.

OwnsHandle

Gets a value indicating whether this object should destroy the underlying native object.

(Inherited from SKObject)
UniqueId

Gets the unique ID associated with the image.

Width

Gets the image width.

Methods

ApplyImageFilter(SKImageFilter, SKRectI, SKRectI, SKRectI, SKPoint)

Applies a given image filter to this image, and return the filtered result.

Create(SKImageInfo)

Creates a new raster-based SKImage using the specified information.

Dispose()

Releases all resources used by this SKNativeObject.

(Inherited from SKNativeObject)
Dispose(Boolean)

Releases the unmanaged resources used by the SKImage and optionally releases the managed resources.

Encode()

Encodes the image using the Png format.

Encode(SKEncodedImageFormat, Int32)

Encodes the image using the specified format.

Encode(SKImageEncodeFormat, Int32)

Encodes the image using the specified format.

Encode(SKPixelSerializer)

Encodes the image using the specified serializer.

FromAdoptedTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType)

Creates a new image from the specified texture.

FromAdoptedTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType)

Creates a new image from the specified texture.

FromAdoptedTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType, SKColorSpace)

Creates a new image from the specified texture.

FromAdoptedTexture(GRContext, GRBackendTexture, SKColorType)

Creates a new image from the specified texture.

FromAdoptedTexture(GRContext, GRBackendTextureDesc)

Creates a new image from the specified texture descriptor.

FromAdoptedTexture(GRContext, GRBackendTextureDesc, SKAlphaType)

Creates a new image from the specified texture descriptor.

FromAdoptedTexture(GRContext, GRGlBackendTextureDesc)

Creates a new image from the specified OpenGL texture descriptor.

FromAdoptedTexture(GRContext, GRGlBackendTextureDesc, SKAlphaType)

Creates a new image from the specified OpenGL texture descriptor.

FromBitmap(SKBitmap)

Creates a new image from the provided SKBitmap.

FromData(SKData)

Creates a new image from an encoded image wrapped by the data.

FromData(SKData, SKRectI)

Creates a new image from an encoded image wrapped by the data.

FromEncodedData(Byte[])

Creates a new image from an encoded image buffer.

FromEncodedData(SKData)

Creates a new image from an encoded image wrapped by the data.

FromEncodedData(SKData, SKRectI)

Creates a new image from an encoded image wrapped by the data.

FromEncodedData(SKStream)

Creates a new image from an encoded image stream.

FromEncodedData(Stream)

Creates a new image from an encoded image stream.

FromEncodedData(String)

Creates a new image from an encoded image file.

FromPicture(SKPicture, SKSizeI)

Creates a new image from the provided SKPicture.

FromPicture(SKPicture, SKSizeI, SKMatrix)

Creates a new image from the provided SKPicture.

FromPicture(SKPicture, SKSizeI, SKMatrix, SKPaint)

Creates a new image from the provided SKPicture.

FromPicture(SKPicture, SKSizeI, SKPaint)

Creates a new image from the provided SKPicture.

FromPixelCopy(SKImageInfo, Byte[])

Creates a new image from a copy of an in-memory buffer.

FromPixelCopy(SKImageInfo, Byte[], Int32)

Creates a new image from a copy of an in-memory buffer.

FromPixelCopy(SKImageInfo, IntPtr)

Creates a new image from a copy of an in-memory buffer.

FromPixelCopy(SKImageInfo, IntPtr, Int32)

Creates a new image from a copy of an in-memory buffer.

FromPixelCopy(SKImageInfo, IntPtr, Int32, SKColorTable)

Creates a new image from a copy of an in-memory buffer.

FromPixelCopy(SKImageInfo, SKStream)

Creates a new image from a copy of the stream data.

FromPixelCopy(SKImageInfo, SKStream, Int32)

Creates a new image from a copy of the stream data.

FromPixelCopy(SKImageInfo, Stream)

Creates a new image from a copy of the stream data.

FromPixelCopy(SKImageInfo, Stream, Int32)

Creates a new image from a copy of the stream data.

FromPixelCopy(SKPixmap)

Creates a new image from a copy of an in-memory buffer.

FromPixelData(SKImageInfo, SKData, Int32)

Creates a new image from an in-memory buffer.

FromPixels(SKImageInfo, IntPtr)

Creates a new image from an in-memory buffer.

FromPixels(SKImageInfo, IntPtr, Int32)

Creates a new image from an in-memory buffer.

FromPixels(SKImageInfo, SKData, Int32)

Creates a new image from an in-memory buffer.

FromPixels(SKPixmap)

Creates a new image from an in-memory buffer.

FromPixels(SKPixmap, SKImageRasterReleaseDelegate)

Creates a new image from an in-memory buffer.

FromPixels(SKPixmap, SKImageRasterReleaseDelegate, Object)

Creates a new image from an in-memory buffer.

FromTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType, SKColorSpace)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType, SKColorSpace, SKImageTextureReleaseDelegate)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTexture, GRSurfaceOrigin, SKColorType, SKAlphaType, SKColorSpace, SKImageTextureReleaseDelegate, Object)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTexture, SKColorType)

Creates a new image from the specified texture.

FromTexture(GRContext, GRBackendTextureDesc)

Creates a new image from the specified texture descriptor.

FromTexture(GRContext, GRBackendTextureDesc, SKAlphaType)

Creates a new image from the specified texture descriptor.

FromTexture(GRContext, GRBackendTextureDesc, SKAlphaType, SKImageTextureReleaseDelegate)

Creates a new image from the specified texture descriptor.

FromTexture(GRContext, GRBackendTextureDesc, SKAlphaType, SKImageTextureReleaseDelegate, Object)

Creates a new image from the specified texture descriptor.

FromTexture(GRContext, GRGlBackendTextureDesc)

Creates a new image from the specified OpenGL texture descriptor.

FromTexture(GRContext, GRGlBackendTextureDesc, SKAlphaType)

Creates a new image from the specified OpenGL texture descriptor.

FromTexture(GRContext, GRGlBackendTextureDesc, SKAlphaType, SKImageTextureReleaseDelegate)

Creates a new image from the specified OpenGL texture descriptor.

FromTexture(GRContext, GRGlBackendTextureDesc, SKAlphaType, SKImageTextureReleaseDelegate, Object)

Creates a new image from the specified OpenGL texture descriptor.

PeekPixels()

Returns the pixmap if the image is raster-based.

PeekPixels(SKPixmap)

Returns the pixmap if the image is raster-based.

ReadPixels(SKImageInfo, IntPtr, Int32, Int32, Int32)

Copies the pixels from the image into the specified buffer.

ReadPixels(SKImageInfo, IntPtr, Int32, Int32, Int32, SKImageCachingHint)

Copies the pixels from the image into the specified buffer.

ReadPixels(SKPixmap, Int32, Int32)

Copies the pixels from the image into the specified buffer.

ReadPixels(SKPixmap, Int32, Int32, SKImageCachingHint)

Copies the pixels from the image into the specified buffer.

ScalePixels(SKPixmap, SKFilterQuality)

Copies the pixels from this image into the destination pixmap, scaling the image if the dimensions differ.

ScalePixels(SKPixmap, SKFilterQuality, SKImageCachingHint)

Copies the pixels from this image into the destination pixmap, scaling the image if the dimensions differ.

Subset(SKRectI)

Returns a new image that is a subset of this image.

ToRasterImage()

Returns a raster-based image of the current image.

ToShader(SKShaderTileMode, SKShaderTileMode)

Creates a new bitmap shader from the current image.

ToShader(SKShaderTileMode, SKShaderTileMode, SKMatrix)

Creates a new bitmap shader from the current image.

Applies to