ملاحظات الإصدار لـ Aspose.PSD for .NET 23.5

الرقم الملخص الفئة
PSDNET-343 دعم فلتر: تحسين -> تحسين ميزة
PSDNET-1179 حفظ ملف PSD (RGB/8 بت أو RGB/16 بت) بدون طبقات إلى 32 بت ميزة
PSDNET-1408 تنفيذ التعامل مع كائنات المسار من موارد vsms أو vmsk لطبقة الشكل ميزة
PSDNET-1508 إضافة تأثير نقاط الشبكة على بعضها البعض ميزة

تغييرات الواجهة البرمجية العامة

APIs المضافة:

  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.#ctor
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.Key
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.Layers
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.Length
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.PsdVersion
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.Signature
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.LrXxResource.Save(Aspose.PSD.StreamContainer,System.Int32)
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath.IsInverted
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath.IsNotLinked
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath.IsDisabled
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath.GetItems
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPath.SetItems(Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape[])
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape.IsClosed
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape.PathOperations
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape.GetItems
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape.SetItems(Aspose.PSD.FileFormats.Core.VectorPaths.BezierKnotRecord[])
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IStrokeSettings
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.#ctor(Aspose.PSD.FileFormats.Core.VectorPaths.LengthRecord,Aspose.PSD.FileFormats.Core.VectorPaths.BezierKnotRecord[])
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.IsClosed
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.PathOperations
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.ShapeIndex
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.GetItems
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.SetItems(Aspose.PSD.FileFormats.Core.VectorPaths.BezierKnotRecord[])
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PathShape.ToVectorPathRecords
  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.IsFillStartsWithAllPixels
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.FillColor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.Version
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.IsDisabled
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.IsNotLinked
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.IsInverted
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.GetItems
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.VectorPath.SetItems(Aspose.PSD.FileFormats.Psd.Layers.LayerResources.IPathShape[])
  • T:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter
  • M:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter.#ctor
  • M:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter.#ctor(Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.DescriptorStructure)
  • P:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter.Name
  • P:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter.FilterId
  • F:Aspose.PSD.FileFormats.Psd.Layers.SmartFilters.SharpenSmartFilter.FilterType

APIs المحذوفة:

  • M:Aspose.PSD.FileFormats.Core.VectorPaths.VectorPathRecordFactory.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.Key
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.Layers
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.Length
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.PsdVersion
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.Signature
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr16Resource.Save(Aspose.PSD.StreamContainer,System.Int32)
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.#ctor(System.Int32)
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.Key
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.Layers
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.Length
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.PsdVersion
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.Signature
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.Lr32Resource.Save(Aspose.PSD.StreamContainer,System.Int32)

أمثلة الاستخدام:

PSDNET-343. دعم فلتر: تحسين -> تحسين

string sourceFile = "sharpen_source.psd";
string outputPsd = "sharpen_output.psd";
string outputPng = "sharpen_output.png";

void AssertAreEqual(object expected, object actual)
{
    if (!object.Equals(expected, actual))
    {
        throw new Exception("الكائنات ليست متساوية.");
    }
}

using (var image = (PsdImage)Image.Load(sourceFile))
{
    SmartObjectLayer smartObj = (SmartObjectLayer)image.Layers[1];

    // تحرير الفلاتر الذكية
    SharpenSmartFilter sharpen = (SharpenSmartFilter)smartObj.SmartFilters.Filters[0];

    // التحقق من قيم الفلتر
    AssertAreEqual(BlendMode.Normal, sharpen.BlendMode);
    AssertAreEqual(100d, sharpen.Opacity);
    AssertAreEqual(true, sharpen.IsEnabled);

    // تحديث قيم الفلتر
    sharpen.BlendMode = BlendMode.Divide;
    sharpen.Opacity = 75;
    sharpen.IsEnabled = false;

    // إضافة عناصر فلتر جديدة
    var filters = new List<SmartFilter>(smartObj.SmartFilters.Filters);
    filters.Add(new SharpenSmartFilter());
    smartObj.SmartFilters.Filters = filters.ToArray();

    // تطبيق التغييرات
    smartObj.SmartFilters.UpdateResourceValues();
    smartObj.UpdateModifiedContent();

    image.Save(outputPsd);
    image.Save(outputPng, new PngOptions());
}

PSDNET-1179. حفظ ملف PSD (RGB/8 بت أو RGB/16 بت) بدون طبقات إلى 32 بت

string inputFile =  "input_8bit_rle.psd";
string outputPsdFile = "output_32bit.psd";
string outputImageFile32 = "output_from_32bit.png";

using (PsdImage srcImg = (PsdImage)Image.Load(inputFile))
{
    PsdOptions totalOptions = new PsdOptions() { ChannelBitsCount = 32, ColorMode = ColorModes.Rgb };
    srcImg.Save(outputPsdFile, totalOptions);

    using (var img32 = Image.Load(outputPsdFile))
    {
        img32.Save(outputImageFile32, new PngOptions() { ColorType = PSD.FileFormats.Png.PngColorType.TruecolorWithAlpha });
    }
}

PSDNET-1408. تنفيذ التعامل مع كائنات المسار من موارد vsms أو vmsk لطبقة الشكل

string srcFile = "ShapeLayerTest.psd";
string outFile = "ShapeLayerTest-out.psd";

using (PsdImage image = (PsdImage)Image.Load(srcFile, new PsdLoadOptions { LoadEffectsResource = true }))
{
    Layer shapeLayer = image.Layers[1];
    VectorPathDataResource vectorPathDataResource = (VectorPathDataResource)shapeLayer.Resources[1];

    bool isFillStartsWithAllPixels;
    List<IPathShape> shapes = GetShapesFromResource(vectorPathDataResource, out isFillStartsWithAllPixels);

    // إزالة شكل واحد
    shapes.RemoveAt(1);

    // حفظ البيانات المعدلة إلى المورد
    List<VectorPathRecord> path = new List<VectorPathRecord>();
    path.Add(new PathFillRuleRecord(null));
    path.Add(new InitialFillRuleRecord(isFillStartsWithAllPixels));

    for (ushort i = 0; i < shapes.Count; i++)
    {
        PathShape shape = (PathShape)shapes[i];
        shape.ShapeIndex = i;
        path.AddRange(shape.ToVectorPathRecords());
    }

    vectorPathDataResource.Paths = path.ToArray();

    image.Save(outFile);
}

// التحقق من القيم المعدلة في الملف المحفوظ
using (PsdImage image = (PsdImage)Image.Load(outFile, new PsdLoadOptions { LoadEffectsResource = true }))
{
    Layer shapeLayer = image.Layers[1];
    VectorPathDataResource vectorPathDataResource = (VectorPathDataResource)shapeLayer.Resources[1];

    bool isFillStartsWithAllPixels;
    List<IPathShape> shapes = GetShapesFromResource(vectorPathDataResource, out isFillStartsWithAllPixels);

    // يجب أن يحتوي الملف المحفوظ على شكل واحد
    AssertAreEqual(1, shapes.Count);
}

void AssertAreEqual(object expected, object actual, string message = null)
{
    if (!object.Equals(expected, actual))
    {
        throw new Exception(message ?? "الكائنات ليست متساوية.");
    }
}

List<IPathShape> GetShapesFromResource(VectorPathDataResource vectorPathDataResource,out bool isFillStartsWithAllPixels)
{
    List<IPathShape> shapes = new List<IPathShape>();
    LengthRecord lengthRecord = null;
    isFillStartsWithAllPixels = false;
    List<BezierKnotRecord> bezierKnotRecords = new List<BezierKnotRecord>();

    foreach (var pathRecord in vectorPathDataResource.Paths)
    {
        if (pathRecord is LengthRecord)
        {
            if (bezierKnotRecords.Count > 0)
            {
                shapes.Add(new PathShape(lengthRecord, bezierKnotRecords.ToArray()));
                lengthRecord = null;
                bezierKnotRecords.Clear();
            }

            lengthRecord = (LengthRecord)pathRecord;
        }
        else if (pathRecord is BezierKnotRecord)
        {
            bezierKnotRecords.Add((BezierKnotRecord)pathRecord);
        }
        else if (pathRecord is InitialFillRuleRecord)
        {
            InitialFillRuleRecord initialFillRuleRecord = (InitialFillRuleRecord)pathRecord;
            isFillStartsWithAllPixels = initialFillRuleRecord.IsFillStartsWithAllPixels;
        }
    }

    if (bezierKnotRecords.Count > 0)
    {
        shapes.Add(new PathShape(lengthRecord, bezierKnotRecords.ToArray()));
        lengthRecord = null;
        bezierKnotRecords.Clear();
    }

    return shapes;
}

PSDNET-1508. إضافة تأثير نقاط الشبكة على بعضها البعض

string sourceFile = "Bottom_Right.psd";
string outputFile = "output.png";

using (var image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions { AllowWarpRepaint = true }))
{
    image.Save(outputFile, new PngOptions { ColorType = PngColorType.TruecolorWithAlpha});
}