WarpSettings.GridSize

WarpSettings.GridSize property

Gets or sets the size of the warp grid. Default is 1.

public Size GridSize { get; set; }

Examples

The following code demonstrates support of WarpSettings.GridSize property.

[C#]

string sourceFile = "pirate_x3.psd";
string outputFile = "export.png";

using (var psdImage = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { AllowWarpRepaint = true, LoadEffectsResource = true }))
{
    // Get warp settings
    WarpSettings warpSettings = ((SmartObjectLayer)(psdImage.Layers[0])).WarpSettings;

    // Set new size
    // For the Photoshop value can be between 1 and 50 and you can not save PSD file correctly.
    warpSettings.GridSize = new Size(100, 100);

    // Set valid value
    warpSettings.GridSize = new Size(3, 3);

    // Render example file with x3 grid
    psdImage.Save(outputFile, new PngOptions
    {
        ColorType = PngColorType.TruecolorWithAlpha
    });
}

See Also