Class AnimatedDataSectionStructure
अंतर्वस्तु
[
छिपाना
]AnimatedDataSectionStructure class
एनिमेटेड डेटा वाला अनुभाग।
public class AnimatedDataSectionStructure : OSTypeStructure
गुण
| नाम | विवरण | 
|---|---|
| Items { get; } | एनिमेटेड डेटा अनुभाग संरचनाओं को प्राप्त या सेट करता है। | 
| override Key { get; } | संरचना कुंजी प्राप्त करता है। | 
| KeyName { get; set; } | कुंजी नाम प्राप्त या सेट करता है। | 
| override Length { get; } | हो जाता है OSTypeStructureबाइट्स में लंबाई. | 
तरीकों
| नाम | विवरण | 
|---|---|
| virtual GetHeaderLength() | हेडर की लंबाई प्राप्त करता है। | 
| Save(StreamContainer) | संरचना को निर्दिष्ट स्ट्रीम कंटेनर में सहेजता है। | 
| SaveWithoutKeyName(StreamContainer) | संरचना को निर्दिष्ट स्ट्रीम कंटेनर में सहेजता है। | 
खेत
| नाम | विवरण | 
|---|---|
| const StructureKey | AnDs. की संरचना कुंजी की पहचान करता है | 
उदाहरण
निम्न कोड प्रदर्शित करता है कि एनिमेटेड डेटा के टाइमलाइन फ्रेम में विलंब समय को कैसे सेट/अपडेट किया जाए।
[C#]
string sourceFile = "3_animated.psd";
string outputPsd = "output_3_animated.psd";
T FindStructure<T>(IEnumerable<OSTypeStructure> structures, string keyName) where T : OSTypeStructure
{
    foreach (var structure in structures)
    {
        if (structure.KeyName.ClassName == keyName)
        {
            return structure as T;
        }
    }
    return null;
}
OSTypeStructure[] AddOrReplaceStructure(IEnumerable<OSTypeStructure> structures, OSTypeStructure newStructure)
{
    List<OSTypeStructure> listOfStructures = new List<OSTypeStructure>(structures);
    for (int i = 0; i < listOfStructures.Count; i++)
    {
        OSTypeStructure structure = listOfStructures[i];
        if (structure.KeyName.ClassName == newStructure.KeyName.ClassName)
        {
            listOfStructures.RemoveAt(i);
            break;
        }
    }
    listOfStructures.Add(newStructure);
    return listOfStructures.ToArray();
}
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
    foreach (var imageResource in image.ImageResources)
    {
        if (imageResource is AnimatedDataSectionResource)
        {
            var animatedData =
                (AnimatedDataSectionStructure) (imageResource as AnimatedDataSectionResource).AnimatedDataSection;
            var framesList = FindStructure<ListStructure>(animatedData.Items, "FrIn");
            var frame1 = (DescriptorStructure)framesList.Types[1];
            // 100 सेंटी-सेकंड मान के साथ फ़्रेम विलंब रिकॉर्ड बनाता है जो 1 सेकंड के बराबर है।
            var frameDelay = new IntegerStructure(new ClassID("FrDl"));
            frameDelay.Value = 100; // सेंटी-सेकंड में समय निर्धारित करें।
            frame1.Structures = AddOrReplaceStructure(frame1.Structures, frameDelay);
            break;
        }
    }
    image.Save(outputPsd);
}
यह सभी देखें
- class OSTypeStructure
- नाम स्थान Aspose.PSD.FileFormats.Psd.Layers.LayerResources
- सभा Aspose.PSD