How to read pixel values in Silverlight Image control?
Is it possible to read pixel values from an Image control in Silverlight 4 without copying Image pixels into a WritableBitmap? I know how to do that with the Wr开发者_如何学GoitableBitmap.
I would like to read the value of a pixel my mouse is over.
I can track my mouse move over the loaded image in the Image control reading relevant XY coordinates. I would like to avoid allocating a WritableBitmap object and do the expensive pix copy.
Thanks for suggestions. V
No, it's not possible.
You can render the Image once in the MouseButtonDown event and use the rendered bitmap in the MouseMove event to get better performance.
精彩评论