Class ImageExtensions
public static class ImageExtensions
- Inheritance
-
ImageExtensions
- Inherited Members
Methods
AsTypeHint(ImageFileFormat)
public static string AsTypeHint(this ImageFileFormat imageFormat)
Parameters
imageFormatImageFileFormat
Returns
Copy(IMemoryImage)
Creates a new image with the same content, dimensions, and resolution as this image.
public static IMemoryImage Copy(this IMemoryImage source)
Parameters
sourceIMemoryImage
Returns
Copy(IMemoryImage, ImageContext)
Creates a new image with the same content, dimensions, and resolution as this image.
public static IMemoryImage Copy(this IMemoryImage source, ImageContext imageContext)
Parameters
sourceIMemoryImageimageContextImageContext
Returns
CopyBlank(IMemoryImage)
Creates a new (empty) image with the same dimensions, pixel format, and resolution as this image.
public static IMemoryImage CopyBlank(this IMemoryImage source)
Parameters
sourceIMemoryImage
Returns
CopyBlankWithPixelFormat(IMemoryImage, ImageContext, ImagePixelFormat)
Creates a new (empty) image with the same dimensions and resolution as this image, and the specified pixel format.
public static IMemoryImage CopyBlankWithPixelFormat(this IMemoryImage source, ImageContext imageContext, ImagePixelFormat pixelFormat)
Parameters
sourceIMemoryImageimageContextImageContextpixelFormatImagePixelFormat
Returns
CopyBlankWithPixelFormat(IMemoryImage, ImagePixelFormat)
Creates a new (empty) image with the same dimensions and resolution as this image, and the specified pixel format.
public static IMemoryImage CopyBlankWithPixelFormat(this IMemoryImage source, ImagePixelFormat pixelFormat)
Parameters
sourceIMemoryImagepixelFormatImagePixelFormat
Returns
CopyTo(IMemoryImage, IMemoryImage)
Copies the content of this image to the destination image. It does not need to be the same pixel format, but if it's different, there may be some loss of information (e.g. when converting color to gray or black/white).
public static void CopyTo(this IMemoryImage source, IMemoryImage destination)
Parameters
sourceIMemoryImagedestinationIMemoryImage
CopyWithPixelFormat(IMemoryImage, ImageContext, ImagePixelFormat)
Creates a new image with the same content, dimensions, and resolution as this image, but possibly with a different pixel format. This can result in some loss of information (e.g. when converting color to gray or black/white).
public static IMemoryImage CopyWithPixelFormat(this IMemoryImage source, ImageContext imageContext, ImagePixelFormat pixelFormat)
Parameters
sourceIMemoryImageimageContextImageContextpixelFormatImagePixelFormat
Returns
CopyWithPixelFormat(IMemoryImage, ImagePixelFormat)
Creates a new image with the same content, dimensions, and resolution as this image, but possibly with a different pixel format. This can result in some loss of information (e.g. when converting color to gray or black/white).
public static IMemoryImage CopyWithPixelFormat(this IMemoryImage source, ImagePixelFormat pixelFormat)
Parameters
sourceIMemoryImagepixelFormatImagePixelFormat
Returns
PerformAllTransforms(IMemoryImage, IEnumerable<Transform>)
public static IMemoryImage PerformAllTransforms(this IMemoryImage image, IEnumerable<Transform> transforms)
Parameters
imageIMemoryImagetransformsIEnumerable<Transform>
Returns
PerformTransform(IMemoryImage, Transform)
public static IMemoryImage PerformTransform(this IMemoryImage image, Transform transform)
Parameters
imageIMemoryImagetransformTransform
Returns
Render(IRenderableImage)
public static IMemoryImage Render(this IRenderableImage image)
Parameters
imageIRenderableImage
Returns
Save(IRenderableImage, Stream, ImageFileFormat, ImageSaveOptions?)
Saves the image to the given stream. The file format must be specified.
public static void Save(this IRenderableImage image, Stream stream, ImageFileFormat imageFormat = ImageFileFormat.Unknown, ImageSaveOptions? options = null)
Parameters
imageIRenderableImageThe image to save.
streamStreamThe stream to save the image to.
imageFormatImageFileFormatThe file format to use.
optionsImageSaveOptionsOptions for saving, e.g. JPEG quality.
Save(IRenderableImage, string, ImageFileFormat, ImageSaveOptions?)
Saves the image to the given file path. If the file format is unspecified, it will be inferred from the file extension if possible.
public static void Save(this IRenderableImage image, string path, ImageFileFormat imageFormat = ImageFileFormat.Unknown, ImageSaveOptions? options = null)
Parameters
imageIRenderableImageThe image to save.
pathstringThe path to save the image file to.
imageFormatImageFileFormatThe file format to use.
optionsImageSaveOptionsOptions for saving, e.g. JPEG quality.
SaveToMemoryStream(IMemoryImage, ImageFileFormat, ImageSaveOptions?)
Saves the image to a new MemoryStream object. The file format must be specified.
public static MemoryStream SaveToMemoryStream(this IMemoryImage image, ImageFileFormat imageFormat, ImageSaveOptions? options = null)
Parameters
imageIMemoryImageThe image to save.
imageFormatImageFileFormatThe file format to use.
optionsImageSaveOptionsOptions for saving, e.g. JPEG quality.
Returns
SaveToMemoryStream(IRenderableImage, ImageFileFormat, ImageSaveOptions?)
Saves the image to a new MemoryStream object. The file format must be specified.
public static MemoryStream SaveToMemoryStream(this IRenderableImage image, ImageFileFormat imageFormat, ImageSaveOptions? options = null)
Parameters
imageIRenderableImageThe image to save.
imageFormatImageFileFormatThe file format to use.
optionsImageSaveOptionsOptions for saving, e.g. JPEG quality.
Returns
UpdateLogicalPixelFormat(IMemoryImage)
public static ImagePixelFormat UpdateLogicalPixelFormat(this IMemoryImage image)
Parameters
imageIMemoryImage