I have a control with a gradiant background. On the MouseDown or MouseUp event I want to capture what color the pixel is immeidately under the mouse pointer. How would I do that?
I have a control with a gradiant background. On the MouseDown or MouseUp event
Share
I created a behavior that can be attached to an Image object to grab the color, which is 100% WPF. Here is the behavior; it could be tweaked to work with any “Visual”, not just an Image.
[Note: I hardcoded 96dpi for the creation of RenderTargetBitmap… your milage may vary]