aspose.zip (159.9 KB)
HI, I used the following code to covert our psd file to png.
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
{
try
{
using (PsdImage image = (PsdImage)Image.Load(@"./wwwroot/Psd/basic.psd"))
{
// Find Layer using layer's name
var layerToUpdateText = (TextLayer)FindLayer("headCopy", image);
// Simple way to update text
layerToUpdateText.UpdateText("Main Copy");
// Save the updated PSD file
image.Save(stream, new Aspose.PSD.ImageOptions.PngOptions());
return File(stream, "image/png");
}
}
catch (Exception e)
{
_logger.Error(e.Message);
return null;
}
}
But I got a message as blow.
"Image loading failed.
{“The type initializer for '\u0002 ’ threw an exception.”}
I dont know what problem is on my source.
Please let me know how I can fix this error.
Thanks.