MlstResource.Items

MlstResource.Items property

Gets or sets the structures.

public OSTypeStructure[] Items { get; }

Examples

The following code demonstrates support of MlstResource resource that gives a low-level mechanism to manipulate the layer states.

[C#]

string sourceFile = "image1219.psd";
string outputPsd = "output_image1219.psd";

using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    Layer layer1 = image.Layers[1];
    ShmdResource shmdResource = (ShmdResource)layer1.Resources[8];
    MlstResource mlstResource = (MlstResource)shmdResource.SubResources[0];

    ListStructure layerStatesList = (ListStructure)mlstResource.Items[1];
    DescriptorStructure layersStateOnFrame1 = (DescriptorStructure)layerStatesList.Types[1];
    BooleanStructure layerEnabled = (BooleanStructure)layersStateOnFrame1.Structures[0];

    // Disable layer 1 on frame 1
    layerEnabled.Value = false;

    image.Save(outputPsd);
}

See Also