【问题标题】:Windows Phone 8, how to convert an image to .png?Windows Phone 8,如何将图像转换为 .png?
【发布时间】:2015-01-29 22:45:10
【问题描述】:

对于 Windows Phone 8(我假设它与 Windows 8 类似),如何将获得的任何图像转换为 .png?

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

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

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

谢谢!

【问题讨论】:

  • 请注意标签是独立的,不能组合起来创建新的术语。例如,结合windowsphone 并不意味着您在谈论Windows Phone。

标签: image image-manipulation windows-phone-8


【解决方案1】:

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

如果您只需要将 WriteableBitmap 保存为 JPEG 格式,则可以使用一个很好的第 3 方框架ToolStack C# PNG Writer Library

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

【讨论】:

  • 你觉得 imageTools 怎么样? imagetools.codeplex.com/… 我看到这个有一段时间没有更新了,所以我不确定它是否可以在 WP8 上运行,但它也提供了 WriteableBitmapEx 似乎没有提供的 bmp。
  • 我很确定 ImageTools for WP7 不支持其中一种格式……JPG 或 PNG。尝试使用它,它在运行时失败。
  • 好的,我回家后会研究一下 WriteableBitmapEx,看看它是如何工作的。有什么东西也可以转换为 .bmp 吗?我正在尝试在不需要网络服务的情况下在手机上进行尽可能多的图像转换。
【解决方案2】:

要考虑的一件事是使用应用外部的程序来转换图像。

我使用油漆或 gimp。您可以免费下载 gimp,它是一个不错的程序。

这是一个开始的地方:

http://www.gimp.org/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多