Skip to content
This repository was archived by the owner on Aug 29, 2026. It is now read-only.

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IronDrawing.Examples

Runnable C# examples for IronDrawing, a free and open-source .NET graphics library that replaces System.Drawing.Common with types that convert implicitly to and from SkiaSharp, ImageSharp, MAUI Graphics, and System.Drawing itself.

Install

dotnet add package IronSoftware.System.Drawing

Quickstart

using IronSoftware.Drawing;

// Load an image from disk into an AnyBitmap
var bitmap = AnyBitmap.FromFile("input.png");

// Save it back out in a different format
bitmap.SaveAs("result.jpg");

// Export to a byte array or a stream for network or database use
byte[] bytes = bitmap.ExportBytes();

using var stream = new MemoryStream();
bitmap.ExportStream(stream, AnyBitmap.ImageFormat.Jpeg, 100);

AnyBitmap converts implicitly to and from System.Drawing.Bitmap, SkiaSharp.SKBitmap, SixLabors.ImageSharp.Image, and Microsoft.Maui.Graphics.Platform.PlatformImage, so it can sit between two libraries that would otherwise not agree on an image type. Color, Rectangle, Size, Point, and Font behave the same way.

IronDrawing is free and open source — no license key is required.

What's in this repo

Each folder contains a self-contained .NET project you can open and run:

  • examples/ — focused snippets demonstrating individual features
  • quickstart/ — an end-to-end project scaffold

Common tasks covered

  • Loading, cloning, and saving AnyBitmap images across formats
  • Casting between AnyBitmap and System.Drawing, SkiaSharp, ImageSharp, and MAUI image types
  • Exporting images to byte[] and MemoryStream, and to a string with ToString()
  • Reading and setting individual pixels
  • Multi-frame images: creating multi-page TIFF and GIF, counting frames, extracting a single frame
  • Color creation, 32-bit ARGB conversion, and color-depth inspection
  • CropRectangle construction, casting, and measurement-unit conversion
  • Point, PointF, Rectangle, RectangleF, Size, and SizeF arithmetic, casting, and equality

Platform support

.NET Standard 2.0 and .NET 6 — which covers .NET 8, 7, 6, 5, .NET Core, and .NET Framework 4.6.1+. Windows, macOS, Linux, Docker, Azure, and AWS. See the documentation for environment-specific notes.

Documentation and support

About

This repository is maintained by Iron Software. IronDrawing is free and open source; the rest of the Iron Suite is commercial.

About

C# graphics library that replaces System.Drawing.Common with AnyBitmap, Color, Rectangle, Font, Point, and Size types converting implicitly to and from SkiaSharp, ImageSharp, MAUI Graphics, and System.Drawing. Runnable .NET examples for image loading, format export, multi-frame TIFF and GIF, and pixel access. Open source.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages