Is it possible to generate an image from a silverlight control so that the control would render itself and its contents to an image so that I can do sime pixel manipulation on the image?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
After searching the Silverlight forums, it seems that this feature isn't available yet, despite many requests. Although, Silverlight 3 beta was just released this week and I'm not sure what the status is on this issue in regards to that release.
There is no way to achieve this in Silverlight 2. I have seen people work around this limitation by posting XAML to a server which would use WPF to render it to a bitmap (using RenderTargetBitmap) and return an image.
However, the just released Silverlight 3 Beta includes a WritableBitmap class which can be used to render a Silverlight UIElement into pixels. In the beta there is however a limitation; once you render an element into the bitmap you cannot access its pixels. This restriction should be eased somewhat in the final release.
Silverlight 3 Beta also includes pixel shaders, so you can write a custom shader in HLSL and apply it to any UIElement - this might be the best solution for you. This tutorial video should get you started on writing and using pixel shaders in Silverlight 3 Beta. http://silverlight.net/learn/learnvideo.aspx?video=187303