如何使用Paint.NET的PSD-plugin保存png格式的PSD层?
尝试这样做:
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);但是行img = Image.FromStream(stream,true,true);抛出“参数无效”异常。
任何其他通过C#/C++实现的解决方案也是可以接受的。提前谢谢。
发布于 2012-03-23 01:12:28
你有没有想过问一下PSD插件的作者?顺便说一句,Paint.NET没有授权作为软件开发工具包使用,只能作为应用程序使用。
发布于 2015-01-23 01:01:31
第一种解决方案不再适用于最新版本,请改用:
var psd = new PhotoshopFile.PsdFile("YourPhotoshop Path as string", Encoding.ASCII);
// or
var psd = new PhotoshopFile.PsdFile("Your Photoshop File Path as string", Encoding.Default);保存也是如此。
https://stackoverflow.com/questions/8773188
复制相似问题