>>你可以点击这里下载Aspose.PSD for .NET v21.7试用体验。
具体更新内容
key | 概述 | 类别 |
---|---|---|
PSDNET-806 | 新功能 | |
PSDNET-917 | Aspose.PSD 21.6: ImageSaveException 试图将 PSD 转换为 PNG | Bug修复 |
PSDNET-858 | 添加到 Aspose.PSD .Net 5.0 配置 | 增强功能 |
新功能解析
string outputFilePng = "result_fontEditTest.png"; string outputFilePsd = "fontEditTest.psd"; void AssertAreEqual(object expected, object actual) { if (!object.Equals(expected, actual)) { throw new Exception("Objects are not equal."); } } using (var image = new PsdImage(500, 500)) { FillLayer backgroundFillLayer = FillLayer.CreateInstance(FillType.Color); ((IColorFillSettings)backgroundFillLayer.FillSettings).Color = Color.White; image.AddLayer(backgroundFillLayer); TextLayer textLayer = image.AddTextLayer("Text 1", new Rectangle(10, 35, image.Width, 35)); ITextPortion firstPortion = textLayer.TextData.Items[0]; firstPortion.Style.FontName = FontSettings.GetAdobeFontName("Comic Sans MS"); var secondPortion = textLayer.TextData.ProducePortion(); secondPortion.Text = "Text 2"; secondPortion.Paragraph.Apply(firstPortion.Paragraph); secondPortion.Style.Apply(firstPortion.Style); secondPortion.Style.FontName = FontSettings.GetAdobeFontName("Arial"); textLayer.TextData.AddPortion(secondPortion); textLayer.TextData.UpdateLayerData(); image.Save(outputFilePng, new PngOptions()); image.Save(outputFilePsd); } using (var image = (PsdImage)Image.Load(outputFilePsd)) { TextLayer textLayer = (TextLayer)image.Layers[2]; string adobeFontName1 = FontSettings.GetAdobeFontName("Comic Sans MS"); string adobeFontName2 = FontSettings.GetAdobeFontName("Arial"); AssertAreEqual(adobeFontName1, textLayer.TextData.Items[0].Style.FontName); AssertAreEqual(adobeFontName2, textLayer.TextData.Items[1].Style.FontName); }
PSDNET-917——Aspose.PSD 21.6: ImageSaveException 试图将 PSD 转换为 PNG
string srcFile = "input.psd"; string output = "output.png"; using (var image = Aspose.PSD.Image.Load(srcFile)) { image.Save(output, new Aspose.PSD.ImageOptions.PngOptions()); }
如果你想试用Aspose的全部完整功能,可联系在线客服获取30天临时授权体验。
如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!