Aspose.PSD for .NET 20.4 - 릴리스 노트

개요 카테고리
PSDNET-567 ‘벡터 발생 데이터’ 리소스 지원 기능
PSDNET-373 lclrResource (시트 색상 설정) 지원 기능
PSDNET-563 LengthRecord 데이터에서 속성 지원 (경로 작업 (부울 연산), 레이어에서 모양의 인덱스, 베지에 고리 레코드의 개수) 기능
PSDNET-425 이미지 섹션 리소스 #1010 배경 색상 지원 기능
PSDNET-530 런타임에 채우기 레이어 추가 기능
PSDNET-424 이미지 섹션 리소스 #1009 테두리 정보 지원 기능
PSDNET-592 AI 형식 파일의 레이어 지원 기능
PSDNET-256 그라데이션 오버레이 레이어 효과의 읽기 및 편집 지원 기능
PSDNET-257 그라데이션 오버레이 레이어 효과 렌더링 기능
PSDNET-585  GradientOverlayEffect.BlendMode 속성 변경이 Photoshop에 표시되지 않음 버그
PSDNET-561 Grayscale ColorMode 및 채널 당 16비트로 PSD 이미지 저장 문제 수정 버그
PSDNET-560 Grayscale ColorMode 및 채널 당 16비트로 PSD 이미지를 PNG 형식으로 저장 문제 수정 버그

공개 API 변경

추가된 API:

  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.Name
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsTemplate
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsLocked
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsShown
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsPrinted
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsPreview
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.IsImagesDimmed
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.DimValue
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.ColorNumber
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.Red
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.Green
  • P:Aspose.PSD.FileFormats.Ai.AiLayerSection.Blue
  • M:Aspose.PSD.FileFormats.Psd.Layers.FillLayers.FillLayer.CreateInstance(Aspose.PSD.FileFormats.Psd.Layers.FillSettings.FillType)
  • T:Aspose.PSD.FileFormats.Psd.Resources.BackgroundColorResource
  • M:Aspose.PSD.FileFormats.Psd.Resources.BackgroundColorResource.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Resources.BackgroundColorResource.DataSize
  • P:Aspose.PSD.FileFormats.Psd.Resources.BackgroundColorResource.MinimalVersion
  • P:Aspose.PSD.FileFormats.Psd.Resources.BackgroundColorResource.Color
  • T:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource
  • M:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource.DataSize
  • P:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource.MinimalVersion
  • P:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource.Width
  • P:Aspose.PSD.FileFormats.Psd.Resources.BorderInformationResource.Unit
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.BezierKnotRecord.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.InitialFillRuleRecord.#ctor(System.Boolean)
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.LengthRecord.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.LengthRecord.BezierKnotRecordsCount
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.LengthRecord.PathOperations
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.LengthRecord.ShapeIndex
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.Save(Aspose.PSD.StreamContainer,System.Int32)
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.TypeToolKey
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.Signature
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.Key
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.PsdVersion
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.Version
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.Length
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VogkResource.ShapeOriginSettings
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.VectorShapeOriginSettings
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.VectorShapeOriginSettings.#ctor(System.Boolean,System.Int32)
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.VectorShapeOriginSettings.IsShapeInvalidated
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.VectorShapeOriginSettings.OriginIndex
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.PathOperations
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.PathOperations.ExcludeOverlappingShapes
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.PathOperations.CombineShapes
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.PathOperations.SubtractFrontShape
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPaths.PathOperations.IntersectShapeAreas
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPathDataResource.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VsmsResource.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VmskResource.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.GradientColorPoint.#ctor(Aspose.PSD.Color,System.Int32,System.Int32)

제거된 API:

  • 없음

사용 예시:

PSDNET-567. ‘벡터 발생 데이터’ 리소스 지원

         // VogkResource 지원

        static void ExampleOfVogkResourceSupport()

        {

            string fileName = "VectorOriginationDataResource.psd";

            string outFileName = "out_VectorOriginationDataResource_.psd";

            using (var psdImage = (PsdImage)Image.Load(fileName))

            {

                var resource = GetVogkResource(psdImage);

                // 읽기

                if (resource.ShapeOriginSettings.Length != 1 ||

                    !resource.ShapeOriginSettings[0].IsShapeInvalidated ||

                    resource.ShapeOriginSettings[0].OriginIndex != 0)

                {

                    throw new Exception("VogkResource were read wrong.");

                }

                // 편집

                resource.ShapeOriginSettings = new[]

                {

                    resource.ShapeOriginSettings[0],

                    new VectorShapeOriginSettings(true, 1)

                };

                psdImage.Save(outFileName);

            }

        }

        static VogkResource GetVogkResource(PsdImage image)

        {

            var layer = image.Layers[1];

            VogkResource resource = null;

            var resources = layer.Resources;

            for (int i = 0; i < resources.Length; i++)

            {

                if (resources[i] is VogkResource)

                {

                    resource = (VogkResource)resources[i];

                    break;

                }

            }

            if (resource == null)

            {

                throw new Exception("VogkResourcenot found.");

            }

            return resource;

        }   

PSDNET-373. lclrResource (시트 색상 설정) 지원

         static void CheckSheetColorsAndRerverse(SheetColorHighlightEnum[] sheetColors, PsdImage img)

        {

            int layersCount = img.Layers.Length;

            for (int layerIndex = 0; layerIndex < layersCount; layerIndex++)

            {

                Layer layer = img.Layers[layerIndex];

                LayerResource[] resources = layer.Resources;

                foreach (LayerResource layerResource in resources)

                {

                    // lcrl 리소스는 항상 psd 파일 리소스 목록에 포함됩니다.

                    LclrResource resource = layerResource as LclrResource;

                    if (resource != null)

                    {

                        if (resource.Color != sheetColors[layerIndex])

                        {

                            throw new Exception("Sheet Color has been read wrong");

                        }

                        // 스타일 시트 색상의 역전. 레이어 색상 강조 설정.

                        resource.Color = sheetColors[layersCount - layerIndex - 1];

                        break;

                    }

                }

            }

        }

            string sourceFilePath = "AllLclrResourceColors.psd";

            string outputFilePath = "AllLclrResourceColorsReversed.psd";

            // 파일에서 레이어 강조 색상의 순서는 다음과 같습니다.

            SheetColorHighlightEnum[] sheetColors = new SheetColorHighlightEnum[] {

                SheetColorHighlightEnum.Red,

                SheetColorHighlightEnum.Orange,

                SheetColorHighlightEnum.Yellow,

                SheetColorHighlightEnum.Green,

                SheetColorHighlightEnum.Blue,

                SheetColorHighlightEnum.Violet,

                SheetColorHighlightEnum.Gray,

                SheetColorHighlightEnum.NoColor

            };            

            // 레이어 시트 색상은 레이어를 시각적으로 강조하는 데 사용됩니다.

            // 예를 들어 PSD에서 일부 레이어를 업데이트한 다음 원하는 레이어를 색상으로 강조할 수 있습니다.

            using (PsdImage img = (PsdImage)Image.Load(sourceFilePath))

            {

                CheckSheetColorsAndRerverse(sheetColors, img);

                img.Save(outputFilePath, new PsdOptions());

            }

            using (PsdImage img = (PsdImage)Image.Load(outputFilePath))

            {

                // 색상을 역으로 해야 함

                Array.Reverse(sheetColors);

                CheckSheetColorsAndRerverse(sheetColors, img);

            }

PSDNET-563. LengthRecord 데이터의 속성 지원 (경로 작업 (부울 연산), 레이어에서 모양의 인덱스, 베지에 고리 레코드의 개수)

            string fileName = "PathOperationsShape.psd";

            using (var im = (PsdImage)Image.Load(fileName))

            {

                VsmsResource resource = null;

                foreach (var layerResource in im.Layers[1].Resources)

                {

                    if (layerResource is VsmsResource)

                    {

                        resource = (VsmsResource)layerResource;

                        break;

                    }

                }

                LengthRecord lengthRecord0 = (LengthRecord)resource.Paths[2];

                LengthRecord lengthRecord1 = (LengthRecord)resource.Paths[7];

                LengthRecord lengthRecord2 = (LengthRecord)resource.Paths[11];

                // 여기서 모양간의 결합 방법 변경.

                lengthRecord0.PathOperations = PathOperations.ExcludeOverlappingShapes;

                lengthRecord1.PathOperations = PathOperations.IntersectShapeAreas;

                lengthRecord2.PathOperations = PathOperations.SubtractFrontShape;

                im.Save("out_" + fileName);

            }

PSDNET-425. Image Section Resource #1010 Background color 지원

             string sourceFile = "input.psd";

            string outputFile = "output.psd";

            using (var image = (PsdImage)Image.Load(sourceFile))

            {

                ResourceBlock[] imageResources = image.ImageResources;

                BackgroundColorResource backgroundColorResource = null;

                foreach (var imageResource in imageResources)

                {

                    if (imageResource is BackgroundColorResource)

                    {

                        backgroundColorResource = (BackgroundColorResource)imageResource;

                        break;

                    }

                }

                // 배경 색상 리소스 업데이트

                backgroundColorResource .Color = Color.DarkRed;

                image.Save(outputFile);

            }

PSDNET-530. 런타임에 채우기 레이어 추가

             string outputPsd = "output.psd";

            using (var image = new PsdImage(100, 100))

            {

                FillLayer colorFillLayer = FillLayer.CreateInstance(FillType.Color);

                colorFillLayer.DisplayName = "Color Fill Layer";

                image.AddLayer(colorFillLayer);

                FillLayer gradientFillLayer = FillLayer.CreateInstance(FillType.Gradient);

                gradientFillLayer.DisplayName = "Gradient Fill Layer";

                image.AddLayer(gradientFillLayer);

                FillLayer patternFillLayer = FillLayer.CreateInstance(FillType.Pattern);

                patternFillLayer.DisplayName = "Pattern Fill Layer";

                patternFillLayer.Opacity = 50;

                image.AddLayer(patternFillLayer);

                image.Save(outputPsd);

            }

PSDNET-424. Image Section Resource #1009 Border information 지원

             string sourceFile = "input.psd";

            string outputFile = "output.psd";

            using (var image = (PsdImage)Image.Load(sourceFile))

            {

                ResourceBlock[] imageResources = image.ImageResources;

                BorderInformationResource borderInfoResource = null;

                foreach (var imageResource in imageResources)

                {

                    if (imageResource is BorderInformationResource)

                    {

                        borderInfoResource = (BorderInformationResource)imageResource;

                        break;

                    }

                }

                // 테두리 정보 리소스 업데이트

                borderInfoResource.Width = 0.1;

                borderInfoResource.Unit = PhysicalUnit.Inches;

                image.Save(outputFile);

            }

PSDNET-592. AI 형식 파일의 레이어 지원

         void AssertIsTrue(bool condition, string message)

        {

            if (!condition)

            {

                throw new FormatException(message);

            }

        }

        string sourceFileName = "form_8_2l3_7.ai";

        string outputFileName = "form_8_2l3_7_export";

        using (AiImage image = (AiImage)Image.Load(sourceFileName))

        {

            AiLayerSection layer0 = image.Layers[0];

            AssertIsTrue(layer0 != null, "Layer 0 should be not null.");

            AssertIsTrue(layer0.Name == "Layer 4", "The Name property of the layer 0 should be Layer 4");

            AssertIsTrue(!layer0.IsTemplate, "The IsTemplate property of the layer 0 should be false.");

            AssertIsTrue(layer0.IsLocked, "The IsLocked property of the layer 0 should be true.");

            AssertIsTrue(layer0.IsShown, "The IsShown property of the layer 0 should be true.");

            AssertIsTrue(layer0.IsPrinted, "The IsPrinted property of the layer 0 should be true.");

            AssertIsTrue(!layer0.IsPreview, "The IsPreview property of the layer 0 should be false.");

            AssertIsTrue(layer0.IsImagesDimmed, "The IsImagesDimmed property of the layer 0 should be true.");

            AssertIsTrue(layer0.DimValue == 51, "The DimValue property of the layer 0 should be 51.");

            AssertIsTrue(layer0.ColorNumber == 0, "The ColorNumber property of the layer 0 should be 0.");

            AssertIsTrue(layer0.Red == 79, "The Red property of the layer 0 should be 79.");

            AssertIsTrue(layer0.Green == 128, "The Green property of the layer 0 should be 128.");

            AssertIsTrue(layer0.Blue == 255, "The Blue property of the layer 0 should be 255.");

            AssertIsTrue(layer0.RasterImages.Length == 0, "The pixels length property of the raster image in the layer 0 should equals 0.");

            AiLayerSection layer1 = image.Layers[1];

            AssertIsTrue(layer1 != null, "Layer 1 should be not null.");

            AssertIsTrue(layer1.Name == "Layer 1", "The Name property of the layer 1 should be Layer 1");

            AssertIsTrue(layer1.RasterImages.Length == 1, "The length property of the raster images in the layer 1 should equals 1.");

            AiRasterImageSection rasterImage = layer1.RasterImages[0];

            AssertIsTrue(rasterImage