如何将WriteableBitmap转换为jpg或其他一些常见格式? [英] How can i convert WriteableBitmap to jpg or some other common format?

查看:286
本文介绍了如何将WriteableBitmap转换为jpg或其他一些常见格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,允许用户执行各种操作,例如旋转和缩放图像,最后,当用户单击保存"时,图像应保存在服务器上.一切正常,但问题是,因为我在使用WriteableBitmapEx将其转换为字节数组后直接保存了WriteableBitmap,保存的图像也是WriteableBitmap,所以我无法使用普通的Picture Viewer对其进行查看.

I have one application that allows user to do various things like rotating and scaling an image and finally when the user clicks on save, the image should get saved on the server. Everything works out fine but the problem is since I am directly saving the WriteableBitmap after converting it to bytearray using WriteableBitmapEx, the saved image is also WriteableBitmap and so I am not able to view it using common Picture Viewer.

我希望将图像另存为JPEG.我该怎么办?

I want my image to be saved as a JPEG. How can I do this?

推荐答案

安吉,这是约翰·帕帕(John Papa)提供的示例,该示例显示了如何将WriteableBitmaps保存到PNG.

Hey Ankit, here is a sample by John Papa that shows how to save WriteableBitmaps to PNG's.

http://johnpapa .net/silverlight/saving-snapshots-to-png-in-silverlight-4-and-the-webcam/

他使用两个选项: http://imagetools.codeplex.com/

并且: http://blogs.msdn.com/b/jstegman/archive/2008/04/21/dynamic-image-generation-in-silverlight.aspx

我建议使用ImageTools路线.

I would suggest the ImageTools route.

这篇关于如何将WriteableBitmap转换为jpg或其他一些常见格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆