public static void Run()
{
// ExStart:ImportImageToPSDLayer
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_PSD();
// Load a PSD file as an image and caste it into PsdImage
using (PsdImage image = (PsdImage)Image.Load(dataDir + "samplePsd.psd"))
{
// Extract a layer from PSDImage
Layer layer = image.Layers[1];
// Load the image that is needed to be imported into the PSD file.
using (RasterImage drawImage = (RasterImage)Image.Load(dataDir + "aspose_logo.png"))
{
// Call DrawImage method of the Layer class and pass the image instance.
layer.DrawImage(new Point(10, 10), drawImage);
}
// Save the results to output path.
image.Save(dataDir + "ImportImageToPSDLayer_out.psd", new PsdOptions());
}
// ExEnd:ImportImageToPSDLayer
}
}