美文网首页.NET
.NET 图片格式转换HEIC到JPG

.NET 图片格式转换HEIC到JPG

作者: Charles2018 | 来源:发表于2022-06-15 20:59 被阅读0次

转换效果图


image.png image.png

nuget引入

Magick.NET-Q8-x64

代码:

// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.

using System.IO;
using ImageMagick;

var desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var outPath = Path.Combine(desktop,"利群");
var inPath = Path.Combine(desktop,"利群-蓝-iPhone");

foreach(var file in Directory.GetFiles(inPath))
{
    var sPath = Path.Combine(outPath,Path.GetFileName(file).Split(".").First() + ".jpg");
    var image = new MagickImage(file);
    image.Write(sPath);
}

相关文章

网友评论

    本文标题:.NET 图片格式转换HEIC到JPG

    本文链接:https://www.haomeiwen.com/subject/bxtfvrtx.html