I had the original Problem that System.Drawing does not work in UWP applications. after a short web search ImageProcessor (https://imageprocessor.org/imageprocessor/#about) showed up. My current situation is:
I am trying to change a white image to an certain color, now it seams that ImageProcessor uses System.Drawing.Color but that makes no problem. What does make a problem is that if i address an object of ImageFactory it responds with this error Message: CS7069 Reference to type 'Image' claims it is defined in 'System.Drawing', but it could not be found.
Here is my Code:
byte[] photoBytes = File.ReadAllBytes(source);
using (MemoryStream inStream = new MemoryStream(photoBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
using (ImageFactory imageFactory = new ImageFactory(preserveExifData: true))
{
imageFactory.Load(inStream).BackgroundColor(Color.FromArgb(argb[0],argb[1],argb[2], argb[3])).Save(outStream);
}
}
}
The red line is under imageFactory.Load.
If you know how to fix this or if you know hoe to do it different that would be cool. Thank you in advance
I have managed to install ImageProcessor in a uwp app and I got the following warning:
Made a .net Core console app - same warning.
It appears that ImageProcessor requires a .Net target framework.
In-fact I have made a simple .net 4.7 console app and this is the result:
On inspection of the nuget packages it clearly states the dependency: