IText.TextOrientation

IText.TextOrientation property

Metin yönünü alır veya ayarlar.

public TextOrientation TextOrientation { get; set; }

Mülk değeri

Metin yönü.

Örnekler

Aşağıdaki kod, yeni TextOrientation özelliğini düzenleme yeteneğini gösterir. Bu, şu anda işlemeyi etkilemez, ancak yalnızca özellik değerini düzenlemenize izin verir.

[C#]

string src = "1336test.psd";
string output = "out_1336test.psd";

using (var image = (PsdImage)Image.Load(src))
{
    var textLayer = image.Layers[1] as TextLayer;
    if (textLayer.TextData.TextOrientation == TextOrientation.Vertical)
    {
        // Doğru okuma
    }
    else
    {
        throw new Exception("Incorrect reading of TextOrientation property value");
    }

    textLayer.TextData.TextOrientation = TextOrientation.Horizontal;
    textLayer.TextData.UpdateLayerData();

    image.Save(output);
}

using (var image = (PsdImage)Image.Load(output))
{
    var textLayer = image.Layers[1] as TextLayer;
    if (textLayer.TextData.TextOrientation == TextOrientation.Horizontal)
    {
        // Doğru okuma
    }
    else
    {
        throw new Exception("Incorrect reading of TextOrientation property value");
    }
}

Ayrıca bakınız