Silverlight: create an image from silverlight controls

Is it possible to create an image from a silverlight control so that the control displays itself and its contents on the image so that I can manipulate the pixels of the image in the image?

+2
source share
2 answers

There is no way to achieve this in Silverlight. I saw people get around this limitation by sending XAML to a server that will use WPF to render it into a bitmap (using RenderTargetBitmap) and return the image.

However, the just-released Silverlight 3 Beta includes a WritableBitmap class that can be used to render Silverlight UIElement in pixels. However, there is a limitation in the beta; once you render an element into a bitmap, you cannot access its pixels. This limitation should be somewhat eased in the final version.

Silverlight 3 Beta also includes pixel shaders, so you can write your own shader in HLSL and apply it to any UIElement - this may be the best solution for you. In this tutorial video, you should start writing and using pixel shaders in Silverlight 3 Beta. http://silverlight.net/learn/learnvideo.aspx?video=187303

+1
source

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


All Articles