I am trying to create new instance of Image class with SixLabors.Imagesharp but I got error. The system I work with used the old ImageSharp and We want to renew nuget packages and use SixLabors.ImageSharp instead.
The code used to be like this: OLD Code with ImageSharp:
var resultImage = new Image<Rgba32>(outputImageWidth, outputImageHeight);
The new code I try to write with SixLabors.ImageSharp is exactly the same but this time I got the massage:
Severity Code Description Project File Linem Suppression State
Error CS0315 The type 'SixLabors.ImageSharp.PixelFormats.Rgba32' cannot be used as type parameter 'TPixel' in the generic type or method 'Image<TPixel>'. There is no boxing conversion from 'SixLabors.ImageSharp.PixelFormats.Rgba32' to '?'.
I tried a lot of other ways to create a new Image but I failed. Do you have any idea how I can create new Image using SixLabors.Imagesharp?