IronSoftware.Drawing

repository·develop·Indexed 40 days ago

https://github.com/iron-software/ironsoftware.system.drawing

A free, open-source, cross-platform replacement for System.Drawing.Common in .NET projects. It provides unified graphics types—including AnyBitmap, Color, Rectangle, Size, Font, and Point—that support implicit casting between System.Drawing, SkiaSharp, ImageSharp, and Microsoft.Maui.Graphics. Compatible with .NET 5 through .NET 9, .NET Core, .NET Standard, and .NET Framework across Windows, macOS, Linux, Docker, Azure, and AWS.

Tokens
3.6K
Snippets
7
Records
19
Agent score
46%

What's inside IronSoftware.Drawing

  1. Overview of IronSoftware.Drawing

    develop

    IronSoftware.Drawing is an open-source library designed to help C# developers replace System.Drawing.Common in .NET projects. It provides cross-platform compatible versions of core graphics types, enabling consistent behavior across different operating systems and environments like Docker, Azure, and AWS.

    Key features include universally compatible versions of common graphics classes that support implicit casting between various popular imaging libraries.

  2. Cross-platform compatibility of IronSoftware.Drawing

    develop

    IronSoftware.Drawing is designed to work across various .NET runtimes and operating systems, making it suitable for cloud and containerized environments.

    Supported Runtimes:

    • .NET 9, .NET 8, .NET 7, .NET 6, .NET 5
    • .NET Core
    • .NET Standard
    • .NET Framework

    Supported Platforms:

    • Windows
    • macOS
    • Linux
    • Docker
    • Azure
    • AWS
  3. Implicit casting support for Rectangle and RectangleF

    develop

    The Rectangle class provides compatibility for integer-based rectangles, while RectangleF handles floating-point rectangles. Supported formats include:

    FormatTo RectangleFrom RectangleTo RectangleFFrom RectangleF
    System.Drawing.Rectangle✅✅
    System.Drawing.RectangleF✅✅
    SkiaSharp.SKRect✅✅
    SkiaSharp.SKRectI✅✅
    SixLabors.ImageSharp.Rectangle✅✅
    SixLabors.ImageSharp.RectangleF✅✅
  4. Implicit casting support for AnyBitmap

    develop

    The AnyBitmap class provides universal compatibility for bitmap and image operations. It supports implicit casting to and from the following formats:

    FormatTo AnyBitmapFrom AnyBitmap
    System.Drawing.Bitmap✅✅
    System.Drawing.Image✅✅
    SkiaSharp.SKBitmap✅✅
    SkiaSharp.SKImage✅✅
    SixLabors.ImageSharp✅✅
    Microsoft.Maui.Graphics.Platform.PlatformImage✅✅
  5. Check cross-platform compatibility for IronSoftware.Drawing

    develop

    IronSoftware.Drawing is compatible with the following environments and frameworks:

    • Languages: C#, F#, and VB.NET
    • Frameworks: .NET 9, .NET 8, .NET 7, .NET 6, .NET 5, .NET Core, .NET Standard, and .NET Framework
    • Application Types: Console, Web, and Desktop Apps
    • Operating Systems/Platforms: Windows, macOS, Linux, Docker, Azure, and AWS
    • IDEs: Microsoft Visual Studio, JetBrains ReSharper, and JetBrains Rider
  6. Implicit casting support for Point and PointF

    develop

    The Point and PointF classes provide compatibility for coordinate points. They also support implicit casting between IronSoftware.Drawing.Point and IronSoftware.Drawing.PointF.

    FormatTo PointFrom PointTo PointFFrom PointF
    System.Drawing.Point✅✅
    System.Drawing.PointF✅✅
    SixLabors.ImageSharp.Point✅✅
    SixLabors.ImageSharp.PointF✅✅
    Microsoft.Maui.Graphics.Point✅✅
    Microsoft.Maui.Graphics.PointF✅✅
    SkiaSharp.SKPoint✅✅
    SkiaSharp.SKPointI✅✅
  7. How implicit casting works in IronSoftware.Drawing

    develop

    A core feature of IronSoftware.Drawing is its ability to provide universally compatible classes that support implicit casting between their own types and types from other popular graphics libraries. This allows you to use IronSoftware.Drawing types in codebases that rely on other frameworks without manual conversion.

    Supported Conversions by Type:

    • AnyBitmap: Casts to/from System.Drawing.Bitmap, System.Drawing.Image, SkiaSharp.SKBitmap, SkiaSharp.SKImage, SixLabors.ImageSharp, and Microsoft.Maui.Graphics.Platform.PlatformImage.
    • Color: Casts to/from System.Drawing.Color, SkiaSharp.SKColor, SixLabors.ImageSharp.Color, and SixLabors.ImageSharp.PixelFormats.
    • Rectangle / RectangleF: Casts to/from System.Drawing.Rectangle, System.Drawing.RectangleF, SkiaSharp.SKRect, SkiaSharp.SKRectI, SixLabors.ImageSharp.Rectangle, and SixLabors.ImageSharp.RectangleF.
    • Size / SizeF: Casts to/from System.Drawing.Size, System.Drawing.SizeF, SkiaSharp.SKSize, SkiaSharp.SKSizeI, SixLabors.ImageSharp.Size, SixLabors.ImageSharp.SizeF, and Microsoft.Maui.Graphics.Size/SizeF.
    • Font: Casts to/from System.Drawing.Font, SkiaSharp.SKFont, SixLabors.Fonts.Font, and IronPdf.Font.FontTypes.
    • Point / PointF: Casts to/from System.Drawing.Point, SixLabors.ImageSharp.Point, SixLabors.ImageSharp.PointF, Microsoft.Maui.Graphics.Point, Microsoft.Maui.Graphics.PointF, SkiaSharp.SKPoint, and SkiaSharp.SKPointI.
  8. Implicit casting support for Size and SizeF

    develop

    The Size class provides compatibility for integer-based dimensions, while SizeF handles floating-point dimensions. Supported formats include:

    FormatTo SizeFrom SizeTo SizeFFrom SizeF
    System.Drawing.Size✅✅
    System.Drawing.SizeF✅✅
    SkiaSharp.SKSize✅✅
    SkiaSharp.SKSizeI✅✅
    SixLabors.ImageSharp.Size✅✅
    SixLabors.ImageSharp.SizeF✅✅
    Microsoft.Maui.Graphics.Size✅✅
    Microsoft.Maui.Graphics.SizeF✅✅