添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

var newLayer = new Aspose.PSD.FileFormats.Psd.Layers.Layer(fs);

newLayer.DisplayName = “NewLayer”;

im.AddLayer(newLayer);

im.Save(@“D:\tong\MyProject\Psd\newPsd.psd”, true);

希望在现有psd上 追加一个layer 里面有一张5M左右的jpg 但一直会报 没有足够的内存继续执行程序
Aspose.PSD 版本为21.4.0

            var im = (PsdImage)Image.Load(@"D:\tong\MyProject\Psd\001-.psd");
            var imagePath = @"D:\tong\MyProject\Psd\T_0003.jpg ";
            FileStream fs = new FileStream(imagePath, FileMode.Open);
            using (im)
                var newLayer = new Aspose.PSD.FileFormats.Psd.Layers.Layer(fs);
                newLayer.DisplayName = "NewLayer";
                im.AddLayer(newLayer);
                im.Save(@"D:\tong\MyProject\Psd\newPsd.psd", true);

Psd.zip (6.7 MB)