Manipulating images with .NET Core

后端 未结 4 1673
误落风尘
误落风尘 2020-11-30 02:21

I have updated my project from .NET 4.5 to .NET Core (with ASP.NET Core). I had some very simple code in my previous version that used the bitmap object from System.Dr

相关标签:
4条回答
  • 2020-11-30 02:40

    I've found an implementation of System.Drawing for .NET Core based on Mono's sources being maintained at:

    • https://github.com/CoreCompat/CoreCompat

    The NuGet package is at:

    • https://www.nuget.org/packages/CoreCompat.System.Drawing

    Which you can reference it in your .NET Core App's project.json with:

    {
      "dependencies": {
        "CoreCompat.System.Drawing": "1.0.0-beta006",
        ...
      },
    }
    
    0 讨论(0)
  • 2020-11-30 02:45

    Aspose.Drawing can manipulate images using API compatible with System.Drawing, fully managed and cross-platform with .NET Core 2.0+ support. (I'm one of the developers.)

    0 讨论(0)
  • 2020-11-30 02:49

    You can use now official (from Microsoft) System.Drawing.Common NuGet package.

    0 讨论(0)
  • 2020-11-30 02:55

    Disclaimer: This is my software.

    I'm working on a cross-platform 2D Graphics library that runs on .NET Core It's currently alpha but already supports a comprehensive feature set.

    https://github.com/JimBobSquarePants/ImageSharp

    Example usage.

    using (FileStream stream = File.OpenRead("foo.jpg"))
    using (FileStream output = File.OpenWrite("bar.jpg"))
    {
        Image image = new Image(stream);
        image.Resize(image.Width / 2, image.Height / 2)
             .Greyscale()
             .Save(output);
    }
    
    0 讨论(0)
提交回复
热议问题