How to save PSD layers in png using PSD-plugin for Paint.NET?
Trying to do this way:
System.Drawing.Image img;
var stream = new System.IO.MemoryStream();
var BRW = new PhotoshopFile.BinaryReverseWriter(stream);
var psd = new PhotoshopFile.PsdFile();
psd.Load("c:\\1.psd");
psd.Layers[0].Save(BRW);
stream.Seek(0, System.IO.SeekOrigin.Begin);
img = System.Drawing.Image.FromStream(stream, true, true);
img.Save("c:\\1.png", System.Drawing.Imaging.ImageFormat.Png);
But the line img = Image.FromStream(stream, true, true); throws "Parameter is not valid" exception.
Any other solutions via C#/C++ are also acceptable. Thanks in advance.
Have you thought about asking the author of the PSD plugin? Paint.NET isn't licensed for use as an SDK, by the way, only as an application.