Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions NuGet/IronSoftware.Drawing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Works seamlessly with popular Image and Bitmap formats such as System.Drawing.Bi
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.

Key library features include:
* AnyBitmap: A universally compatible Bitmap class. Implicit casting between System.Drawing.Bitmap, System.Drawing.Image, SkiaSharp.SKBitmap, SkiaSharp.SKImage, SixLabors.ImageSharp, Microsoft.Maui.Graphics.Platform.PlatformImage to IronDrawing.AnyBitmap
* Color: A universally compatible Color class. Implicit casting between System.Drawing.Color, SkiaSharp.SKColor, SixLabors.ImageSharp.Color, SixLabors.ImageSharp.PixelFormats to IronDrawing.Color
* CropRectangle: A universally compatible Rectangle class. Implicit casting between System.Drawing.Rectangle, SkiaSharp.SKRect, SkiaSharp.SKRectI, SixLabors.ImageSharp.Rectangle to IronDrawing.CropRectangle
* Font: A universally compatible Font class. Implicit casting between System.Drawing.Font, SkiaSharp.SKFont, SixLabors.Fonts.Font to IronDrawing.Font
* AnyBitmap: A universally compatible Bitmap class. Implicit casting between System.Drawing.Bitmap, System.Drawing.Image, SkiaSharp.SKBitmap, SkiaSharp.SKImage, SixLabors.ImageSharp, Microsoft.Maui.Graphics.Platform.PlatformImage to IronSoftware.Drawing.AnyBitmap
* Color: A universally compatible Color class. Implicit casting between System.Drawing.Color, SkiaSharp.SKColor, SixLabors.ImageSharp.Color, SixLabors.ImageSharp.PixelFormats to IronSoftware.Drawing.Color
* CropRectangle: A universally compatible Rectangle class. Implicit casting between System.Drawing.Rectangle, SkiaSharp.SKRect, SkiaSharp.SKRectI, SixLabors.ImageSharp.Rectangle to IronSoftware.Drawing.CropRectangle
* Font: A universally compatible Font class. Implicit casting between System.Drawing.Font, SkiaSharp.SKFont, SixLabors.Fonts.Font to IronSoftware.Drawing.Font

IronDrawing can be used within C#, VB.NET, F#, ASP.NET projects, MVC, Web Services, Console & Desktop Applications.
IronSoftware.Drawing can be used within C#, VB.NET, F#, ASP.NET projects, MVC, Web Services, Console & Desktop Applications.

Supports:
* .NET Framework 4.6.2 +
Expand All @@ -33,7 +33,7 @@ Supports:
* .NET 7

For general support and technical inquiries, please email us at: developers@ironsoftware.com</description>
<summary>IronDrawing</summary>
<summary>IronSoftware.System.Drawing helps C# Software Engineers to replace System.Drawing.Common in .NET projects.</summary>
<releaseNotes>* Added support for implicit casting for existing Color, CropRectangle, and Font with those of Microsoft.Maui
* Added support for implicit casting between Rgb48, Rgba64, and IronDrawing.Color</releaseNotes>
<copyright>Copyright © Iron Software 2022</copyright>
Expand Down
103 changes: 56 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
![Nuget](https://img.shields.io/nuget/v/IronDrawing?color=informational&label=latest) ![Installs](https://img.shields.io/nuget/dt/IronDrawing?color=informational&label=installs&logo=nuget) ![Passed](https://img.shields.io/badge/build-%20%E2%9C%93%20258%20tests%20passed%20(0%20failed)%20-107C10?logo=visualstudio) ![windows](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=windows) ![macOS](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=apple) ![linux](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=linux&logoColor=white) ![docker](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=docker&logoColor=white) ![aws](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=amazonaws) ![microsoftazure](https://img.shields.io/badge/%E2%80%8E%20-%20%E2%9C%93-107C10?logo=microsoftazure)
# IronDrawing - Image, Color, Rectangle, and Font class for .NET Applications
IronDrawing is a library developed and maintained by Iron Software that helps C# Software Engineers to replace System.Drawing.Common in .NET projects.
### IronDrawing Features and Capabilities:
- AnyBitmap: A universally compatible Bitmap class. Implicit casting between `IronDrawing.AnyBitmap` and the following:
[![NuGet](https://img.shields.io/nuget/v/IronSoftware.System.Drawing?color=informational&label=latest&logo=nuget)](https://www.nuget.org/packages/IronSoftware.System.Drawing/) [![Installs](https://img.shields.io/nuget/dt/IronSoftware.System.Drawing?color=informational&label=installs&logo=nuget)](https://www.nuget.org/packages/IronSoftware.System.Drawing/) [![GitHub Latest Commit](https://img.shields.io/github/last-commit/iron-software/IronSoftware.Drawing.Common?color=informational&logo=github)](https://github.com/iron-software/IronSoftware.Drawing.Common) [![GitHub Contributors](https://img.shields.io/github/contributors/iron-software/IronSoftware.Drawing.Common?color=informational&logo=github)](https://github.com/iron-software/IronSoftware.Drawing.Common)
# IronSoftware.Drawing - Image, Color, Rectangle, and Font class for .NET Applications
**IronSoftware.Drawing** is an open-source library originally developed by Iron Software that helps C# Software Engineers to replace System.Drawing.Common in .NET projects.
## Table of Contents

- [Features](#ironsoftwaredrawing-features)
- [Compatibility](#ironsoftwaredrawing-has-cross-platform-support-compatibility-with)
- [Using IronSoftware.Drawing](#using-ironsoftwaredrawing)
- [AnyBitmap Example](#anybitmap-code-example)
- [Color Example](#color-code-example)
- [CropRectangle Example](#croprectangle-code-example)
- [Font Example](#font-code-example)
- [Support](#support-available)

## IronSoftware.Drawing Features:
- **AnyBitmap**: A universally compatible Bitmap class. Implicit casting between `IronSoftware.Drawing.AnyBitmap` and the following supported:
- `System.Drawing.Bitmap`
- `System.Drawing.Image`
- `SkiaSharp.SKBitmap`
- `SkiaSharp.SKImage`
- `SixLabors.ImageSharp`
- `Microsoft.Maui.Graphics.Platform.PlatformImage`
- Color: A universally compatible Color class. Implicit casting between `IronDrawing.Color` and the following:
- **Color**: A universally compatible Color class. Implicit casting between `IronSoftware.Drawing.Color` and the following supported:
- `System.Drawing.Color`
- `SkiaSharp.SKColor`
- `SixLabors.ImageSharp.Color`
- `SixLabors.ImageSharp.PixelFormats`
- CropRectangle: A universally compatible Rectangle class. Implicit casting between `IronDrawing.CropRectangle` and the following:
- **CropRectangle**: A universally compatible Rectangle class. Implicit casting between `IronSoftware.Drawing.CropRectangle` and the following supported:
- `System.Drawing.Rectangle`
- `SkiaSharp.SKRect`
- `SkiaSharp.SKRectI`
- `SixLabors.ImageSharp.Rectangle`
- Font: A universally compatible Font class. Implicit casting between `IronDrawing.Font` and the following:
- **Font**: A universally compatible Font class. Implicit casting between `IronSoftware.Drawing.Font` and the following supported:
- `System.Drawing.Font`
- `SkiaSharp.SKFont`
- `SixLabors.Fonts.Font`
### IronDrawing has cross platform support compatibility with:
### IronSoftware.Drawing has cross platform support compatibility with:
- .NET 7, .NET 6, .NET 5, .NET Core, Standard, and Framework
- Windows, macOS, Linux, Docker, Azure, and AWS
## Using IronDrawing
## Using IronSoftware.Drawing
Installing the IronDrawing NuGet package is quick and easy, please install the package like this:
Installing the IronSoftware.Drawing NuGet package is quick and easy, please install the package like this:
```
PM> Install-Package IronDrawing
PM> Install-Package IronSoftware.System.Drawing
```
Once installed, you can get started by adding `using IronDrawing` to the top of your C# code.
Once installed, you can get started by adding `using IronSoftware.Drawing;` to the top of your C# code.
### `AnyBitmap` Code Example
```csharp
using IronDrawing;
using IronSoftware.Drawing;
// Create a new AnyBitmap object
var bitmap = AnyBitmap.FromFile("FILE_PATH");
Expand All @@ -51,69 +61,68 @@ var bytes = bitmap.ExportBytes();
var resultExport = new System.IO.MemoryStream();
bimtap.ExportStream(resultExport, AnyBitmap.ImageFormat.Jpeg, 100);
// Casting between System.Drawing.Bitmap to IronDrawing.AnyBitmap
// Casting between System.Drawing.Bitmap and IronSoftware.Drawing.AnyBitmap
System.Drawing.Bitmap image = new System.Drawing.Bitmap("FILE_PATH");
var anyBitmap = image;
IronSoftware.Drawing.AnyBitmap anyBitmap = image;
anyBitmap.SaveAs("result-from-casting.png");
```
### `Color` Code Example
```csharp
using IronDrawing;
using IronSoftware.Drawing;
// Create a new Color object
Color fromHex = new Color("#191919");
Color fromRgb = new Color(255, 255, 0);
Color fromEnum = Color.Crimson;
// Casting between System.Drawing.Color to IronDrawing.Color
// Casting between System.Drawing.Color and IronSoftware.Drawing.Color
System.Drawing.Color drawingColor = System.Drawing.Color.Red;
IronDrawing.Color ironDrawingColor = drawingColor;
IronSoftware.Drawing.Color ironColor = drawingColor;
ironDrawingColor.A;
ironDrawingColor.R;
ironDrawingColor.G;
ironDrawingColor.B;
ironColor.A;
ironColor.R;
ironColor.G;
ironColor.B;
// Luminance is a value from 0 (black) to 100 (white) where 50 is the perceptual "middle grey"
ironDrawingColor.GetLuminance();
IronDrawingColor.GetLuminance();
```
### `CropRectangle` Code Example
```csharp
using IronDrawing;
using IronSoftware.Drawing;
// Create a new CropRectangle object
CropRectangle cropRectangle = new CropRectangle(5, 5, 50, 50);
// Casting between System.Drawing.Rectangle to IronDrawing.CropRectangle
// Casting between System.Drawing.Rectangle and IronSoftware.Drawing.CropRectangle
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(10, 10, 150, 150);
CropRectangle ironDrawingCropRectangle = rectangle;
IronSoftware.Drawing.CropRectangle ironRectangle = rectangle;
ironDrawingCropRectangle.Width;
ironDrawingCropRectangle.Height;
ironDrawingCropRectangle.X;
ironDrawingCropRectangle.Y;
ironRectangle.X;
ironRectangle.Y;
ironRectangle.Width;
ironRectangle.Height;
```
### `Font` Code Example
```csharp
using IronDrawing;
using IronSoftware.Drawing;
// Create a new Font object
Font font = new Font("Times New Roman", FontStyle.Italic | FontStyle.Bold, 30);
// Casting between System.Drawing.Font to IronDrawing.Font
// Casting between System.Drawing.Font and IronSoftware.Drawing.Font
System.Drawing.Font drawingFont = new System.Drawing.Font("Courier New", 30);
IronDrawing.Font ironDrawingFont = drawingFont;
IronSoftware.Drawing.Font ironFont = drawingFont;
ironDrawingFont.FamilyName;
ironDrawingFont.Style;
ironDrawingFont.Size;
ironDrawingFont.Italic;
ironDrawingFont.Bold;
ironFont.FamilyName;
ironFont.Style;
ironFont.Size;
ironFont.Italic;
ironFont.Bold;
```
## Support Available
For more information on Iron Software please visit: [https://ironsoftware.com/](https://ironsoftware.com/)
For general support and technical inquiries, please email us at: developers@ironsoftware.com

For more information about Iron Software please visit our website: [https://ironsoftware.com/](https://ironsoftware.com/)

For general support and technical inquiries, please email us at: developers@ironsoftware.com