Aspose.PSD for .Net更新至新版本v21.5,支持使用矢量路径调整形状图层的大小,支持使用矢量路径调整形状图层的大小,欢迎下载体验。
Aspose.PSD for .Net更新至新版本v21.5,支持使用矢量路径调整形状图层的大小,支持使用矢量路径调整形状图层的大小。
>>你可以点击这里下载Aspose.PSD for .NET v21.5试用体验。
整合所有格式API处理控件Aspose.Total永久授权火热促销中,联系客服立马1分钟了解全部!
具体更新内容
key | 概述 | 类别 |
---|---|---|
PSDNET-758 | 支持使用矢量路径调整形状图层的大小 | 功能 |
PSDNET-862 | 仅调整图层大小时,支持使用矢量路径调整形状图层的大小 | 功能 |
PSDNET-578 | 文本字符串被截断 | Bug修复 |
新功能解析
PSDNET-758——支持使用矢量路径调整形状图层的大小
string sourceFileName = "vectorShapes.psd"; string outputFileName = "out_vectorShapes.psd"; string dataDir = "PSDNET758_1"; string sourcePath = Path.Combine(dataDir, sourceFileName); string outputPath = Path.Combine(dataDir, outputFileName); using (var psdImage = (PsdImage)Image.Load(sourcePath)) { foreach (var layer in psdImage.Layers) { layer.Resize(layer.Width * 5 / 4, layer.Height / 2); } psdImage.Save(outputPath); psdImage.Save(Path.ChangeExtension(outputPath, ".png"), new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha }); }
PSDNET-862——仅调整图层大小时,支持使用矢量路径调整形状图层的大小
// This example shows how to resize layers with a Vogk and vector path resource in the PSD image float scaleX = 0.45f; float scaleY = 1.60f; string dataDir = "PSDNET862_1"; string sourceFileName = Path.Combine(dataDir, "vectorShapes.psd"); using (PsdImage image = (PsdImage)Image.Load(sourceFileName)) { for (int layerIndex = 1; layerIndex < image.Layers.Length; layerIndex++, scaleX += 0.25f, scaleY -= 0.25f) { var layer = image.Layers[layerIndex]; var newWidth = (int)Math.Round(layer.Width * scaleX); var newHeight = (int)Math.Round(layer.Height * scaleY); layer.Resize(newWidth, newHeight); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); string outputName = string.Format("resized_{0}_{1}_{2}", layerIndex, scaleX, scaleY); string outputPath = Path.Combine(dataDir, outputName + ".psd"); string outputPngPath = Path.Combine(dataDir, outputName + ".png"); image.Save(outputPath, new PsdOptions(image)); image.Save(outputPngPath, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha }); } }
如果你想试用Aspose的全部完整功能,可联系在线客服获取30天临时授权体验。
如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!