Search Results for

    Show / Hide Table of Contents

    Class AnyBitmap

    A universally compatible Bitmap format for .NET 7, .NET 6, .NET 5, and .NET Core. As well as compatibility with Windows, NanoServer, IIS, macOS, Mobile, Xamarin, iOS, Android, Google Cloud, Azure, AWS, and Linux.

    Works nicely with popular Image and Bitmap formats such as System.Drawing.Bitmap, SkiaSharp, SixLabors.ImageSharp, Microsoft.Maui.Graphics.

    Implicit casting means that using this class to input and output Bitmap and image types from public API's gives full compatibility to all image type fully supported by Microsoft.

    Unlike System.Drawing.Bitmap this bitmap object is self-memory-managing and does not need to be explicitly 'used' or 'disposed'.

    Inheritance
    System.Object
    AnyBitmap
    Implements
    System.IDisposable
    Namespace: IronSoftware.Drawing
    Assembly: IronSoftware.Drawing.Common.dll
    Syntax
    public class AnyBitmap : Object, IDisposable

    Constructors

    AnyBitmap(AnyBitmap, Int32, Int32)

    Declaration
    public AnyBitmap(AnyBitmap original, int width, int height)
    Parameters
    Type Name Description
    AnyBitmap original

    The AnyBitmap from which to create the new AnyBitmap.

    System.Int32 width

    The width of the new AnyBitmap.

    System.Int32 height

    The height of the new AnyBitmap.

    AnyBitmap(Byte[])

    Construct a new Bitmap from binary data (bytes).

    Declaration
    public AnyBitmap(byte[] Bytes)
    Parameters
    Type Name Description
    System.Byte[] Bytes

    A ByteArray of image data in any common format.

    See Also
    FromBytes(Byte[])
    AnyBitmap

    AnyBitmap(MemoryStream)

    Construct a new Bitmap from a System.IO.Stream (bytes).

    Declaration
    public AnyBitmap(MemoryStream Stream)
    Parameters
    Type Name Description
    System.IO.MemoryStream Stream

    A System.IO.Stream of image data in any common format.

    See Also
    FromStream(Stream)
    AnyBitmap

    AnyBitmap(Stream)

    Construct a new Bitmap from a System.IO.Stream (bytes).

    Declaration
    public AnyBitmap(Stream Stream)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    A System.IO.Stream of image data in any common format.

    See Also
    FromStream(MemoryStream)
    AnyBitmap

    AnyBitmap(String)

    Construct a new Bitmap from a file.

    Declaration
    public AnyBitmap(string File)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path./

    See Also
    FromFile(String)
    AnyBitmap

    AnyBitmap(Uri)

    Construct a new Bitmap from a Uri

    Declaration
    public AnyBitmap(Uri Uri)
    Parameters
    Type Name Description
    System.Uri Uri

    The uri of the image.

    See Also
    FromUri(Uri)
    AnyBitmap

    Properties

    BitsPerPixel

    Gets colors depth, in number of bits per pixel.

    Further Documentation:
    Code Example

    Declaration
    public int BitsPerPixel { get; }
    Property Value
    Type Description
    System.Int32

    FrameCount

    Returns the number of frames in our loaded Image. Each “frame” is a page of an image such as Tiff or Gif. All other image formats return 1.

    Further Documentation:
    Code Example

    Declaration
    public int FrameCount { get; }
    Property Value
    Type Description
    System.Int32
    See Also
    GetAllFrames

    GetAllFrames

    Returns all of the cloned frames in our loaded Image. Each "frame" is a page of an image such as Tiff or Gif. All other image formats return an IEnumerable of length 1.

    Further Documentation:
    Code Example

    Declaration
    public IEnumerable<AnyBitmap> GetAllFrames { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<AnyBitmap>
    See Also
    FrameCount
    System.Linq

    Height

    Height of the image.

    Declaration
    public int Height { get; }
    Property Value
    Type Description
    System.Int32

    HorizontalResolution

    Gets the resolution of the image in x-direction.

    Declaration
    public Nullable<double> HorizontalResolution { get; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    Length

    Number of raw image bytes stored

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    System.Int32

    MimeType

    Returns the HTTP MIME types of the image.

    must be one of the following: image/bmp, image/jpeg, image/png, image/gif, image/tiff, image/webp, or image/unknown.

    Declaration
    public string MimeType { get; }
    Property Value
    Type Description
    System.String

    Scan0

    Gets the address of the first pixel data in the AnyBitmap. This can also be thought of as the first scan line in the AnyBitmap.

    Declaration
    public IntPtr Scan0 { get; }
    Property Value
    Type Description
    System.IntPtr

    The address of the first 32bpp BGRA pixel data in the AnyBitmap.

    Stride

    Gets the stride width (also called scan width) of the AnyBitmap object.

    Declaration
    public int Stride { get; }
    Property Value
    Type Description
    System.Int32

    VerticalResolution

    Gets the resolution of the image in y-direction.

    Declaration
    public Nullable<double> VerticalResolution { get; }
    Property Value
    Type Description
    System.Nullable<System.Double>

    Width

    Width of the image.

    Declaration
    public int Width { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    Clone()

    Creates an exact duplicate AnyBitmap

    Further Documentation:
    Code Example

    Declaration
    public AnyBitmap Clone()
    Returns
    Type Description
    AnyBitmap

    Clone(CropRectangle)

    Creates an exact duplicate AnyBitmap of the cropped area.

    Further Documentation:
    Code Example

    Declaration
    public AnyBitmap Clone(CropRectangle Rectangle)
    Parameters
    Type Name Description
    CropRectangle Rectangle

    Defines the portion of this AnyBitmap to copy.

    Returns
    Type Description
    AnyBitmap

    CreateMultiFrameGif(IEnumerable<AnyBitmap>)

    Creates a multi-frame GIF image from multiple AnyBitmaps.

    All images should have the same dimension.

    If not dimension will be scaling to the largest width and height.

    The image dimension still the same with original dimension with background transparent.

    Declaration
    public static AnyBitmap CreateMultiFrameGif(IEnumerable<AnyBitmap> images)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AnyBitmap> images

    Array of AnyBitmap to merge into Gif image.

    Returns
    Type Description
    AnyBitmap

    CreateMultiFrameGif(IEnumerable<String>)

    Creates a multi-frame GIF image from multiple AnyBitmaps.

    All images should have the same dimension.

    If not dimension will be scaling to the largest width and height.

    The image dimension still the same with original dimension with background transparent.

    Declaration
    public static AnyBitmap CreateMultiFrameGif(IEnumerable<string> imagePaths)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> imagePaths

    Array of fully qualified file path to merge into Gif image.

    Returns
    Type Description
    AnyBitmap

    CreateMultiFrameTiff(IEnumerable<AnyBitmap>)

    Creates a multi-frame TIFF image from multiple AnyBitmaps.

    All images should have the same dimension.

    If not dimension will be scaling to the largest width and height.

    The image dimension still the same with original dimension with black background.

    Declaration
    public static AnyBitmap CreateMultiFrameTiff(IEnumerable<AnyBitmap> images)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AnyBitmap> images

    Array of AnyBitmap to merge into Tiff image.

    Returns
    Type Description
    AnyBitmap

    CreateMultiFrameTiff(IEnumerable<String>)

    Creates a multi-frame TIFF image from multiple AnyBitmaps.

    All images should have the same dimension.

    If not dimension will be scaling to the largest width and height.

    The image dimension still the same with original dimension with black background.

    Declaration
    public static AnyBitmap CreateMultiFrameTiff(IEnumerable<string> imagePaths)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> imagePaths

    Array of fully qualified file path to merge into Tiff image.

    Returns
    Type Description
    AnyBitmap

    Dispose()

    Releases all resources used by this AnyBitmap.

    Declaration
    public void Dispose()

    ExportBytes(AnyBitmap.ImageFormat, Int32)

    Exports the Bitmap as bytes encoded in the AnyBitmap.ImageFormat of your choice.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable this feature.

    Declaration
    public byte[] ExportBytes(AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality , 100 is highest.

    Returns
    Type Description
    System.Byte[]

    Transcoded image bytes.

    ExportFile(String, AnyBitmap.ImageFormat, Int32)

    Exports the Bitmap as a file encoded in the AnyBitmap.ImageFormat of your choice.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Further Documentation:
    Code Example

    Declaration
    public void ExportFile(string File, AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality, 100 is highest.

    ExportStream(Stream, AnyBitmap.ImageFormat, Int32)

    Saves the Bitmap to an existing System.IO.Stream encoded in the AnyBitmap.ImageFormat of your choice.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Declaration
    public void ExportStream(Stream Stream, AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    An image encoding format.

    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality, 100 is highest.

    Finalize()

    AnyBitmap destructor

    Declaration
    protected override void Finalize()

    FromBitmap<T>(T)

    Generic method to convert popular image types to AnyBitmap.

    Support includes SixLabors.ImageSharp.Image, SkiaSharp.SKImage, SkiaSharp.SKBitmap, System.Drawing.Bitmap, System.Drawing.Image and Microsoft.Maui.Graphics formats.

    Syntax sugar. Explicit casts already also exist to and from AnyBitmap and all supported types.

    Declaration
    public static AnyBitmap FromBitmap<T>(T OtherBitmapFormat)
    Parameters
    Type Name Description
    T OtherBitmapFormat

    A bitmap or image format from another graphics library.

    Returns
    Type Description
    AnyBitmap

    A AnyBitmap

    Type Parameters
    Name Description
    T

    The Type to cast from. Support includes SixLabors.ImageSharp.Image, SkiaSharp.SKImage, SkiaSharp.SKBitmap, System.Drawing.Bitmap, System.Drawing.Image and Microsoft.Maui.Graphics formats.

    FromBytes(Byte[])

    Create a new Bitmap from a a Byte Array.

    Declaration
    public static AnyBitmap FromBytes(byte[] Bytes)
    Parameters
    Type Name Description
    System.Byte[] Bytes

    A ByteArray of image data in any common format.

    Returns
    Type Description
    AnyBitmap
    See Also
    FromBytes(Byte[])
    AnyBitmap(Byte[])

    FromFile(String)

    Create a new Bitmap from a file.

    Declaration
    public static AnyBitmap FromFile(string File)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    Returns
    Type Description
    AnyBitmap
    See Also
    FromFile(String)
    AnyBitmap

    FromStream(MemoryStream)

    Create a new Bitmap from a System.IO.Stream (bytes).

    Declaration
    public static AnyBitmap FromStream(MemoryStream Stream)
    Parameters
    Type Name Description
    System.IO.MemoryStream Stream

    A System.IO.Stream of image data in any common format.

    Returns
    Type Description
    AnyBitmap
    See Also
    FromStream(Stream)
    AnyBitmap

    FromStream(Stream)

    Create a new Bitmap from a System.IO.Stream (bytes).

    Declaration
    public static AnyBitmap FromStream(Stream Stream)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    A System.IO.Stream of image data in any common format.

    Returns
    Type Description
    AnyBitmap
    See Also
    FromStream(MemoryStream)
    AnyBitmap

    FromUri(Uri)

    Construct a new Bitmap from a Uri

    Declaration
    public static AnyBitmap FromUri(Uri Uri)
    Parameters
    Type Name Description
    System.Uri Uri

    The uri of the image.

    Returns
    Type Description
    AnyBitmap
    See Also
    AnyBitmap
    FromUri(Uri)

    GetBytes()

    The raw image data as byte[] (ByteArray)"/>

    Declaration
    public byte[] GetBytes()
    Returns
    Type Description
    System.Byte[]

    A byte[] (ByteArray)

    GetHashCode()

    Hashing integer based on image raw binary data.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    Int

    GetImageFormat()

    Image formats which AnyBitmap readed.

    Declaration
    public AnyBitmap.ImageFormat GetImageFormat()
    Returns
    Type Description
    AnyBitmap.ImageFormat

    AnyBitmap.ImageFormat

    GetPixel(Int32, Int32)

    Gets the Color of the specified pixel in this AnyBitmap

    This always return an Rgba32 color format.

    Declaration
    public Color GetPixel(int x, int y)
    Parameters
    Type Name Description
    System.Int32 x

    The x-coordinate of the pixel to retrieve.

    System.Int32 y

    The y-coordinate of the pixel to retrieve.

    Returns
    Type Description
    Color

    A Color structure that represents the color of the specified pixel.

    GetStream()

    The raw image data as a System.IO.MemoryStream

    Further Documentation:
    Code Example

    Declaration
    public MemoryStream GetStream()
    Returns
    Type Description
    System.IO.MemoryStream

    System.IO.MemoryStream

    Redact(AnyBitmap, CropRectangle, Color)

    Creates a new bitmap with the region defined by the specified crop rectangle in the specified bitmap redacted with the specified color.

    Declaration
    public static AnyBitmap Redact(AnyBitmap bitmap, CropRectangle cropRectangle, Color color)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    The bitmap to redact.

    CropRectangle cropRectangle

    The crop rectangle defining the region to redact.

    Color color

    The color to use for redaction.

    Returns
    Type Description
    AnyBitmap

    A new bitmap with the specified region redacted.

    Redact(CropRectangle, Color)

    Creates a new bitmap with the region defined by the specified crop rectangle redacted with the specified color.

    Declaration
    public AnyBitmap Redact(CropRectangle cropRectangle, Color color)
    Parameters
    Type Name Description
    CropRectangle cropRectangle

    The crop rectangle defining the region to redact.

    Color color

    The color to use for redaction.

    Returns
    Type Description
    AnyBitmap

    A new bitmap with the specified region redacted.

    RotateFlip(AnyBitmap, AnyBitmap.RotateMode, AnyBitmap.FlipMode)

    Specifies how much an image is rotated and the axis used to flip the image.

    Declaration
    public static AnyBitmap RotateFlip(AnyBitmap bitmap, AnyBitmap.RotateMode rotateMode, AnyBitmap.FlipMode flipMode)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    The AnyBitmap to perform the transformation on.

    AnyBitmap.RotateMode rotateMode

    Provides enumeration over how the image should be rotated.

    AnyBitmap.FlipMode flipMode

    Provides enumeration over how a image should be flipped.

    Returns
    Type Description
    AnyBitmap

    Transformed image

    RotateFlip(AnyBitmap.RotateFlipType)

    Specifies how much an AnyBitmap is rotated and the axis used to flip the image.

    Declaration
    public AnyBitmap RotateFlip(AnyBitmap.RotateFlipType rotateFlipType)
    Parameters
    Type Name Description
    AnyBitmap.RotateFlipType rotateFlipType

    Provides enumeration over how the image should be rotated.

    Returns
    Type Description
    AnyBitmap

    Transformed image

    RotateFlip(AnyBitmap.RotateMode, AnyBitmap.FlipMode)

    Specifies how much an AnyBitmap is rotated and the axis used to flip the image.

    Declaration
    public AnyBitmap RotateFlip(AnyBitmap.RotateMode rotateMode, AnyBitmap.FlipMode flipMode)
    Parameters
    Type Name Description
    AnyBitmap.RotateMode rotateMode

    Provides enumeration over how the image should be rotated.

    AnyBitmap.FlipMode flipMode

    Provides enumeration over how a image should be flipped.

    Returns
    Type Description
    AnyBitmap

    Transformed image

    SaveAs(String)

    Saves the raw image data to a file.

    Declaration
    public void SaveAs(string File)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    See Also
    TrySaveAs(String)

    SaveAs(String, AnyBitmap.ImageFormat, Int32)

    Saves the image data to a file. Allows for the image to be transcoded to popular image formats.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Declaration
    public void SaveAs(string File, AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality , 100 is highest.

    See Also
    TrySaveAs(String, AnyBitmap.ImageFormat, Int32)
    TrySaveAs(String)

    ToBitmap<T>()

    Generic method to convert AnyBitmap to popular image types.

    Support includes SixLabors.ImageSharp.Image, SkiaSharp.SKImage, SkiaSharp.SKBitmap, System.Drawing.Bitmap, System.Drawing.Image and Microsoft.Maui.Graphics formats.

    Syntax sugar. Explicit casts already also exist to and from AnyBitmap and all supported types.

    Declaration
    public T ToBitmap<T>()
    Returns
    Type Description
    T

    A AnyBitmap

    Type Parameters
    Name Description
    T

    The Type to cast to. Support includes SixLabors.ImageSharp.Image, SkiaSharp.SKImage, SkiaSharp.SKBitmap, System.Drawing.Bitmap, System.Drawing.Image and Microsoft.Maui.Graphics formats.

    ToStream(AnyBitmap.ImageFormat, Int32)

    Exports the Bitmap as a System.IO.MemoryStream encoded in the AnyBitmap.ImageFormat of your choice.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Further Documentation:
    Code Example

    Declaration
    public MemoryStream ToStream(AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality, 100 is highest.

    Returns
    Type Description
    System.IO.MemoryStream

    Transcoded image bytes in a System.IO.MemoryStream.

    ToStreamFn(AnyBitmap.ImageFormat, Int32)

    Exports the Bitmap as a FuncSystem.IO.MemoryStream> encoded in the AnyBitmap.ImageFormat of your choice.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Declaration
    public Func<Stream> ToStreamFn(AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality, 100 is highest.

    Returns
    Type Description
    System.Func<System.IO.Stream>

    Transcoded image bytes in a FuncSystem.IO.MemoryStream>.

    ToString()

    A Base64 encoded string representation of the raw image binary data.

    Further Documentation:
    Code Example

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    The bitmap data as a Base64 string.

    See Also
    System.Convert.ToBase64String(System.Byte[])

    TrySaveAs(String)

    Tries to Save the raw image data to a file. returns true on success, false on failure.

    Declaration
    public bool TrySaveAs(string File)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    Returns
    Type Description
    System.Boolean
    See Also
    SaveAs(String)

    TrySaveAs(String, AnyBitmap.ImageFormat, Int32)

    Tries to Save the image data to a file. Allows for the image to be transcoded to popular image formats.

    Add SkiaSharp, System.Drawing.Common, or SixLabors.ImageSharp to your project to enable the encoding feature.

    Declaration
    public bool TrySaveAs(string File, AnyBitmap.ImageFormat Format, int Lossy = 100)
    Parameters
    Type Name Description
    System.String File

    A fully qualified file path.

    AnyBitmap.ImageFormat Format

    An image encoding format.

    System.Int32 Lossy

    JPEG and WebP encoding quality (ignored for all other values of AnyBitmap.ImageFormat). Higher values return larger file sizes. 0 is lowest quality , 100 is highest.

    Returns
    Type Description
    System.Boolean

    returns true on success, false on failure.

    See Also
    SaveAs(String, AnyBitmap.ImageFormat, Int32)

    Operators

    Implicit(AnyBitmap to PlatformImage)

    Implicitly casts to Microsoft.Maui.Graphics.Platform.PlatformImage objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support Microsoft.Maui.Graphics as well.

    Declaration
    public static implicit operator PlatformImage(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a Microsoft.Maui.Graphics.Platform.PlatformImage.

    Returns
    Type Description
    Microsoft.Maui.Graphics.Platform.PlatformImage

    Implicit(AnyBitmap to Image)

    Implicitly casts to SixLabors.ImageSharp.Image objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator Image(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a SixLabors.ImageSharp.Image.

    Returns
    Type Description
    SixLabors.ImageSharp.Image

    Implicit(AnyBitmap to Image<Rgb24>)

    Implicitly casts to SixLabors.ImageSharp.Image objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator Image<Rgb24>(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a SixLabors.ImageSharp.Image.

    Returns
    Type Description
    SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24>

    Implicit(AnyBitmap to Image<Rgba32>)

    Implicitly casts to SixLabors.ImageSharp.Image objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator Image<Rgba32>(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a SixLabors.ImageSharp.Image.

    Returns
    Type Description
    SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgba32>

    Implicit(AnyBitmap to SKBitmap)

    Implicitly casts to SkiaSharp.SKBitmap objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support SkiaSharp.SKBitmap as well.

    Declaration
    public static implicit operator SKBitmap(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is explicitly cast to a SkiaSharp.SKBitmap.

    Returns
    Type Description
    SkiaSharp.SKBitmap

    Implicit(AnyBitmap to SKImage)

    Implicitly casts to SkiaSharp.SKImage objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support SkiaSharp.SKImage as well.

    Declaration
    public static implicit operator SKImage(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a SkiaSharp.SKImage.

    Returns
    Type Description
    SkiaSharp.SKImage

    Implicit(AnyBitmap to Bitmap)

    Implicitly casts to System.Drawing.Bitmap objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support System.Drawing.Common as well.

    Declaration
    public static implicit operator Bitmap(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a System.Drawing.Bitmap.

    Returns
    Type Description
    System.Drawing.Bitmap

    Implicit(AnyBitmap to Image)

    Implicitly casts to System.Drawing.Image objects from AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support System.Drawing.Common as well.

    Declaration
    public static implicit operator Image(AnyBitmap bitmap)
    Parameters
    Type Name Description
    AnyBitmap bitmap

    AnyBitmap is implicitly cast to a System.Drawing.Image.

    Returns
    Type Description
    System.Drawing.Image

    Implicit(PlatformImage to AnyBitmap)

    Implicitly casts Microsoft.Maui.Graphics.Platform.PlatformImage objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support Microsoft.Maui.Graphics as well.

    Declaration
    public static implicit operator AnyBitmap(PlatformImage Image)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.Platform.PlatformImage Image

    Microsoft.Maui.Graphics.Platform.PlatformImage will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(Image to AnyBitmap)

    Implicitly casts SixLabors.ImageSharp.Image objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator AnyBitmap(Image Image)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.Image Image

    SixLabors.ImageSharp.Image will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(Image<Rgb24> to AnyBitmap)

    Implicitly casts SixLabors.ImageSharp.Image objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator AnyBitmap(Image<Rgb24> Image)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgb24> Image

    SixLabors.ImageSharp.Image will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(Image<Rgba32> to AnyBitmap)

    Implicitly casts SixLabors.ImageSharp.Image objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support ImageSharp as well.

    Declaration
    public static implicit operator AnyBitmap(Image<Rgba32> Image)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgba32> Image

    SixLabors.ImageSharp.Image will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(SKBitmap to AnyBitmap)

    Implicitly casts SkiaSharp.SKBitmap objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support SkiaSharp as well.

    Declaration
    public static implicit operator AnyBitmap(SKBitmap Image)
    Parameters
    Type Name Description
    SkiaSharp.SKBitmap Image

    SkiaSharp.SKBitmap will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(SKImage to AnyBitmap)

    Implicitly casts SkiaSharp.SKImage objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support SkiaSharp as well.

    Declaration
    public static implicit operator AnyBitmap(SKImage Image)
    Parameters
    Type Name Description
    SkiaSharp.SKImage Image

    SkiaSharp.SKImage will automatically be cast to AnyBitmap.

    Returns
    Type Description
    AnyBitmap

    Implicit(Bitmap to AnyBitmap)

    Implicitly casts System.Drawing.Bitmap objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support System.Drawing.Common as well.

    Declaration
    public static implicit operator AnyBitmap(Bitmap Image)
    Parameters
    Type Name Description
    System.Drawing.Bitmap Image

    System.Drawing.Bitmap will automatically be cast to AnyBitmap

    Returns
    Type Description
    AnyBitmap

    Implicit(Image to AnyBitmap)

    Implicitly casts System.Drawing.Image objects to AnyBitmap.

    When your .NET Class methods use AnyBitmap as parameters or return types, you now automatically support System.Drawing.Common as well.

    Declaration
    public static implicit operator AnyBitmap(Image Image)
    Parameters
    Type Name Description
    System.Drawing.Image Image

    System.Drawing.Image will automatically be cast to AnyBitmap

    Returns
    Type Description
    AnyBitmap

    Implements

    System.IDisposable
    ☀
    ☾
    Downloads
    • Download with Nuget
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronDrawing to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronDrawing free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.