VogkResource Class
The Vector Origination Data resource.
Inheritance Hierarchy
SystemObject
  Aspose.PSD.FileFormats.Psd.LayersLayerResource
    Aspose.PSD.FileFormats.Psd.Layers.LayerResourcesVogkResource

Namespace: Aspose.PSD.FileFormats.Psd.Layers.LayerResources
Assembly: Aspose.PSD (in Aspose.PSD.dll) Version: 21.12
Syntax
public sealed class VogkResource : LayerResource

The VogkResource type exposes the following members.

Constructors
  NameDescription
Public methodVogkResource
Initializes a new instance of the VogkResource class.
Properties
  NameDescription
Public propertyCode exampleKey
Gets the layer resource key.
(Overrides LayerResourceKey.)
Public propertyCode exampleLength
Gets the layer resource length in bytes.
(Overrides LayerResourceLength.)
Public propertyCode examplePsdVersion
Gets the minimal psd version required for layer resource. 0 indicates no restrictions.
(Overrides LayerResourcePsdVersion.)
Public propertyCode exampleShapeOriginSettings
Gets or sets the shape origin settings.
Public propertySignature
Gets the layer resource signature.
(Overrides LayerResourceSignature.)
Public propertyCode exampleVersion
Gets or sets the version.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodSave
Saves the resource to the specified stream container.
(Overrides LayerResourceSave(StreamContainer, Int32).)
Public methodToString
Returns a String that represents this instance.
(Inherited from LayerResource.)
Fields
  NameDescription
Public fieldStatic memberTypeToolKey
The type tool info key.
Examples
The following example demonstrates the support of VogkResource resource.
[C#]

VogkResource GetVogkResource(PsdImage image)
{
    var layer = image.Layers[1];

    VogkResource resource = null;
    var resources = layer.Resources;
    for (int i = 0; i < resources.Length; i++)
    {
        if (resources[i] is VogkResource)
        {
            resource = (VogkResource)resources[i];
            break;
        }
    }

    if (resource == null)
    {
        throw new Exception("VogkResourcenot found.");
    }

    return resource;
}

string sourceFilePath = "VectorOriginationDataResource.psd";
string outputFilePath = "out_VectorOriginationDataResource_.psd";

using (var psdImage = (PsdImage)Image.Load(sourceFilePath))
{
    var resource = GetVogkResource(psdImage);

    // Reading
    if (resource.ShapeOriginSettings.Length != 1 ||
        !resource.ShapeOriginSettings[0].IsShapeInvalidated ||
        resource.ShapeOriginSettings[0].OriginIndex != 0)
    {
        throw new Exception("VogkResource were read wrong.");
    }

    // Editing
    resource.ShapeOriginSettings = new[]
    {
                    resource.ShapeOriginSettings[0],
                    new VectorShapeOriginSettings(true, 1)
                };

    psdImage.Save(outputFilePath);
}
See Also