首页 > 编程语言 >C# PNG转SVG(使用Aspose.Image)

C# PNG转SVG(使用Aspose.Image)

时间:2022-12-04 10:12:49浏览次数:32  
标签:fileSavePath C# SVG Image VectorRasterizationOptions image Aspose svgOptions

private static bool ConvertPngToSvg(string fileOriginPath, string fileSavePath)
{
	using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(fileOriginPath))
	{
		//do some image processing
		SvgOptions svgOptions = new SvgOptions();
		SvgRasterizationOptions svgRasterizationOptions = new SvgRasterizationOptions();
		svgOptions.VectorRasterizationOptions = svgRasterizationOptions;
		svgOptions.VectorRasterizationOptions.PageWidth = image.Width;
		svgOptions.VectorRasterizationOptions.PageHeight = image.Height;

		image.Save(fileSavePath, svgOptions);
	}

	return true;
}

标签:fileSavePath,C#,SVG,Image,VectorRasterizationOptions,image,Aspose,svgOptions
From: https://www.cnblogs.com/cqpanda/p/16928352.html

相关文章