Windows Phone 8,如何将图像转换为.png?

前端之家收集整理的这篇文章主要介绍了Windows Phone 8,如何将图像转换为.png?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
对于 Windows Phone 8(我假设它与Windows 8类似),如何将他们获得的任何图像转换为.png?

例如,我得到.jpeg或.gif并将其转换为.png.

也有兴趣将.png转换为.jpeg.

在第三方应用程序之前,我更喜欢内置方法.

谢谢!

解决方法

WP7 / WP8中没有内置功能可以从JPG转换为PNG.

如果只需要将WriteableBitmap保存为JPEG,则可以使用一个好的第三方框架.

var myBitmap = new WriteableBitmap(tempBitmap);

// Create the destitnation stream.
var pngDest = new System.IO.IsolatedStorage.IsolatedStorageFileStream("test.png",FileMode.Create,isoStore);

// use the WriteableBitmap extension to write out the PNG
myBitmap.WritePNG(pngDest);

如果您需要功能更全面的工具集(例如加载JPG),请查看WriteableBitmapEx和Rene Schulte @ Convert,Encode And Decode Silverlight WriteableBitmap Data的精彩文章

猜你在找的Windows相关文章