How can i convert WriteableBitmap to jpg or some other common format?

℡╲_俬逩灬. 提交于 2019-12-24 04:26:10

问题


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.

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


回答1:


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/

He uses two options: http://imagetools.codeplex.com/

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

I would suggest the ImageTools route.



来源:https://stackoverflow.com/questions/4683276/how-can-i-convert-writeablebitmap-to-jpg-or-some-other-common-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!