Class ImageExtensions
public static class ImageExtensions
- Inheritance
-
ImageExtensions
- Inherited Members
Methods
AsTypeHint(ImageFileFormat)
public static string AsTypeHint(this ImageFileFormat imageFormat)
Parameters
imageFormat
ImageFileFormat
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
source
IMemoryImage
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
source
IMemoryImageimageContext
ImageContext
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
source
IMemoryImage
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
source
IMemoryImageimageContext
ImageContextpixelFormat
ImagePixelFormat
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
source
IMemoryImagepixelFormat
ImagePixelFormat
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
source
IMemoryImagedestination
IMemoryImage
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
source
IMemoryImageimageContext
ImageContextpixelFormat
ImagePixelFormat
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
source
IMemoryImagepixelFormat
ImagePixelFormat
Returns
PerformAllTransforms(IMemoryImage, IEnumerable<Transform>)
public static IMemoryImage PerformAllTransforms(this IMemoryImage image, IEnumerable<Transform> transforms)
Parameters
image
IMemoryImagetransforms
IEnumerable<Transform>
Returns
PerformTransform(IMemoryImage, Transform)
public static IMemoryImage PerformTransform(this IMemoryImage image, Transform transform)
Parameters
image
IMemoryImagetransform
Transform
Returns
Render(IRenderableImage)
public static IMemoryImage Render(this IRenderableImage image)
Parameters
image
IRenderableImage
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
image
IRenderableImageThe image to save.
stream
StreamThe stream to save the image to.
imageFormat
ImageFileFormatThe file format to use.
options
ImageSaveOptionsOptions 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
image
IRenderableImageThe image to save.
path
stringThe path to save the image file to.
imageFormat
ImageFileFormatThe file format to use.
options
ImageSaveOptionsOptions 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
image
IMemoryImageThe image to save.
imageFormat
ImageFileFormatThe file format to use.
options
ImageSaveOptionsOptions 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
image
IRenderableImageThe image to save.
imageFormat
ImageFileFormatThe file format to use.
options
ImageSaveOptionsOptions for saving, e.g. JPEG quality.
Returns
UpdateLogicalPixelFormat(IMemoryImage)
public static ImagePixelFormat UpdateLogicalPixelFormat(this IMemoryImage image)
Parameters
image
IMemoryImage