public static void Run()
{
// ExStart:UpdateTextLayerInPSDFile
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_PSD();
try
{
// Load a PSD file as an image and caste it into PsdImage
using (PsdImage image = (PsdImage)Image.Load(dataDir + "samplePsd.psd"))
{
PsdImage psdImage = image;
TextLayer textLayer1 = psdImage.Layers[1] as TextLayer;
TextLayer textLayer2 = psdImage.Layers[2] as TextLayer;
Debug.Assert(textLayer2 != null, "textLayer2 != null");
textLayer2.UpdateText("test update", new Point(100, 100), 72.0f, Color.Purple);
psdImage.Save(dataDir + "UpdateTextLayerInPSDFile_out.psd", new PsdOptions { CompressionMethod = CompressionMethod.RLE });
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http:// Www.aspose.com/purchase/default.aspx.");
}
// ExEnd:UpdateTextLayerInPSDFile
}
}