Silverlight Problem: saving in jpeg format

I am new to Silverlight. We are working on silverlight 3.0 and telerik elements.

I want to implement functionality so that a certain part of a file, such as a panel or stack grid, needs to be exported or printed to an image format. I mean, when I click on a specific button, then this part of the application should export in image format.

My first question is: is it possible to implement it in Silverlight3.0?

Or funcitonality is in Silverlight4.0.

If possible, then can someone show me a way to implement it?

Thanks in advance, Amit

+4
source share
2 answers

Silverlight 4 has not added any features that allow you to export raster data to other formats. However, if your goal eventually gets printed, print support has been added in Silverlight 4.

However, codeplex imagetools adds loading / saving from bmp, Png and Jpeg.

+1
source

Here is a tutorial that does what you need: http://blog.blueboxes.co.uk/2009/07/21/rendering-xaml-to-a-jpeg-using-silverlight-3/

Please note: this example uses a third-party library (FjCore) to re-encode the image as a higher quality jpeq, but you do not need to do this to achieve the goal, you can delete this code and just save the bytes of the image directly.

+1
source

Source: https://habr.com/ru/post/1312324/


All Articles