问题
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