iron-software / IronSoftware.System.Drawing

An open-source System.Drawing.Common replacement for .NET 5 and above on all platforms. Bringing together System.Drawing, Maui, and ImageSharp's Bitmap, Image, Font, and Shape types via an agnostic free NuGet package.
Other
114 stars 18 forks source link

IronDrawing - Convert Bitmap to AnyBitmap throws System.InvalidCastException #107

Closed bline-ironsoftware closed 4 months ago

bline-ironsoftware commented 4 months ago

Title

IronDrawing converts bitmap to AnyBitmap throws system invalid cast exception

Description

When using Convert.ChangeType to convert other bitmap formats to AnyBitmap, need to implement the IConvertible interface. However, I converted the other bitmap formats to System.Drawing.Bitmap and directly assigned into AnyBitmap.

Fixes #(issue number) [DW - 11] IronDrawing - Convert Bitmap to AnyBitmap throws System.InvalidCastException

Type of change

Please select the relevant option by placing an 'x' inside the brackets, like this: [x].

How Has This Been Tested?

RUN IronDrawing PR Validation

Checklist:

Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].