Frequency of WPF-slider ValueChanged-Event
In my application I use two sliders to control the brightness and contrast
of certain images and the image has to be completely recalculated pixel by
pixel every single time when either one of the two sliders changes its
value-property. The recalculation of smaller images goes completely fine
and doesn't cause any problems, however, larger images need longer to be
recalculated and the slider thumb moves with a slight delay compared to
the mouse pointer. I do need the image to be recalculated more or less in
real time so simply having an event on MouseLeftButtonUp or similarly is
not acceptable.
The recalculation is initialized using the ValueChanged-event of the
slider. I think a good solution to this problem would be if the event is
not fired as quickly as possible but will at least wait say 50ms before it
is fired again, but is there a property of a slider that can control that?
Another solution I was thinking of, is removing the event from the slider
right at the start when the event gets handled and adding it again some
short time later, but that might cause some delay itself which is also not
preferred here.
I couldn't really find anything on this topic anywhere, so if somebody has
any good suggestions or directions I could use, I would be very greatful.
No comments:
Post a Comment