Silverlight:将 WriteableBitmap 转换为流

发布于 2024-09-09 07:16:30 字数 239 浏览 5 评论 0原文

给定一个 WriteableBitmap,如何将位图保存回图像流(JPG 或 BMP)?

我的场景是:

  1. 显示 OpenFileDialog,让用户选择图像
  2. 将图像加载到 WriteableBitmap
  3. 调整图像
  4. 大小 将图像流发送到 Web 服务

第 4 步是我遇到的问题。我怎样才能从 WriteableBitmap ->溪流?

Given a WriteableBitmap, how can I save the bitmap back into an image stream (JPG or BMP)?

My scenario is:

  1. Show OpenFileDialog, let user select image
  2. Load image into WriteableBitmap
  3. Resize image
  4. Send image stream to web service

Step #4 is what I'm having trouble with. How can I go from WriteableBitmap -> Stream?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆蝶 2024-09-16 07:16:30

好吧,Silverlight 没有任何内置功能可以将 WriteableBitmap 转换为图像流。

经过一番哀嚎和咬牙切齿,我找到了优秀的开源 Silverlight 的 ImageTools 库,它提供了编码器和JPG、BMP、GIF 和 PNG 的解码器。

Ok, so Silverlight doesn't have anything built-in to turn a WriteableBitmap into an image stream.

After much wailing and gnashing of teeth, I found the excellent open source ImageTools library for Silverlight, which provides encoders and decoders for JPG, BMP, GIF, and PNG.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文