Enum PathOperations

PathOperations enumeration

عمليات دمج أشكال المسار (العمليات المنطقية) .

public enum PathOperations

قيم

اسمقيمةوصف
ExcludeOverlappingShapes0استبعاد الأشكال المتداخلة (عملية XOR) .
CombineShapes1دمج الأشكال (عملية أو). هذه هي القيمة الافتراضية في Photoshop.
SubtractFrontShape2اطرح الشكل الأمامي (ليس عملية) .
IntersectShapeAreas3مناطق الشكل المتقاطعة (والتشغيل) .

أمثلة

يوضح المثال التالي من التعليمات البرمجية دعم خصائص LengthRecord الجديدة و PathOperations (العمليات المنطقية) و ShapeIndex و BezierKnotRecordsCount.

[C#]

string sourceFilePath = "PathOperationsShape.psd";
string outputFilePath = "out_PathOperationsShape.psd";

using (var im = (PsdImage)Image.Load(sourceFilePath))
{
    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(outputFilePath);
}

أنظر أيضا