ObjectArrayStructure.ObjectArrayStructure
내용물
[
숨다
]ObjectArrayStructure(string, string, OSTypeStructure[])
의 새 인스턴스를 초기화합니다.ObjectArrayStructure
클래스.
public ObjectArrayStructure(string keyName, string classIdName, OSTypeStructure[] structures)
모수 | 유형 | 설명 |
---|---|---|
keyName | String | 키의 이름입니다. |
classIdName | String | 클래스 식별자의 이름입니다. |
structures | OSTypeStructure[] | 구조. |
예
다음 코드는 ObAr 및 UnFl 서명의 지원을 보여줍니다.
[C#]
void AssertAreEqual(object actual, object expected)
{
if (!object.Equals(actual, expected))
{
throw new FormatException(string.Format("Actual value {0} are not equal to expected {1}.", actual, expected));
}
}
var sourceFilePath = "LayeredSmartObjects8bit2.psd";
using (PsdImage image = (PsdImage)Image.Load(sourceFilePath))
{
UnitArrayStructure verticalStructure = null;
foreach (Layer imageLayer in image.Layers)
{
foreach (var imageResource in imageLayer.Resources)
{
var resource = imageResource as PlLdResource;
if (resource != null && resource.IsCustom)
{
foreach (OSTypeStructure structure in resource.Items)
{
if (structure.KeyName.ClassName == "customEnvelopeWarp")
{
AssertAreEqual(typeof(DescriptorStructure), structure.GetType());
var custom = (DescriptorStructure)structure;
AssertAreEqual(custom.Structures.Length, 1);
var mesh = custom.Structures[0];
AssertAreEqual(typeof(ObjectArrayStructure), mesh.GetType());
var meshObjectArray = (ObjectArrayStructure)mesh;
AssertAreEqual(meshObjectArray.Structures.Length, 2);
var vertical = meshObjectArray.Structures[1];
AssertAreEqual(typeof(UnitArrayStructure), vertical.GetType());
verticalStructure = (UnitArrayStructure)vertical;
AssertAreEqual(verticalStructure.UnitType, UnitTypes.Pixels);
AssertAreEqual(verticalStructure.ValueCount, 16);
break;
}
}
}
}
}
AssertAreEqual(true, verticalStructure != null);
}
또한보십시오
- class OSTypeStructure
- class ObjectArrayStructure
- 네임스페이스 Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures
- 집회 Aspose.PSD
ObjectArrayStructure(int, ClassID, ClassID, string, OSTypeStructure[])
의 새 인스턴스를 초기화합니다.ObjectArrayStructure
클래스.
public ObjectArrayStructure(int key, ClassID keyName, ClassID classID, string className,
OSTypeStructure[] structures)
모수 | 유형 | 설명 |
---|---|---|
key | Int32 | 정수 키입니다. |
keyName | ClassID | 키 이름입니다. |
classID | ClassID | 클래스 식별자입니다. |
className | String | 클래스의 이름입니다. |
structures | OSTypeStructure[] | 구조. |
예외
예외 | 상태 |
---|---|
ArgumentNullException | 클래스 ID가 null입니다. |
예
다음 코드는 ObAr 및 UnFl 서명의 지원을 보여줍니다.
[C#]
void AssertAreEqual(object actual, object expected)
{
if (!object.Equals(actual, expected))
{
throw new FormatException(string.Format("Actual value {0} are not equal to expected {1}.", actual, expected));
}
}
var sourceFilePath = "LayeredSmartObjects8bit2.psd";
using (PsdImage image = (PsdImage)Image.Load(sourceFilePath))
{
UnitArrayStructure verticalStructure = null;
foreach (Layer imageLayer in image.Layers)
{
foreach (var imageResource in imageLayer.Resources)
{
var resource = imageResource as PlLdResource;
if (resource != null && resource.IsCustom)
{
foreach (OSTypeStructure structure in resource.Items)
{
if (structure.KeyName.ClassName == "customEnvelopeWarp")
{
AssertAreEqual(typeof(DescriptorStructure), structure.GetType());
var custom = (DescriptorStructure)structure;
AssertAreEqual(custom.Structures.Length, 1);
var mesh = custom.Structures[0];
AssertAreEqual(typeof(ObjectArrayStructure), mesh.GetType());
var meshObjectArray = (ObjectArrayStructure)mesh;
AssertAreEqual(meshObjectArray.Structures.Length, 2);
var vertical = meshObjectArray.Structures[1];
AssertAreEqual(typeof(UnitArrayStructure), vertical.GetType());
verticalStructure = (UnitArrayStructure)vertical;
AssertAreEqual(verticalStructure.UnitType, UnitTypes.Pixels);
AssertAreEqual(verticalStructure.ValueCount, 16);
break;
}
}
}
}
}
AssertAreEqual(true, verticalStructure != null);
}