-
In my business, I need to perform some operations on the image, such as replacement, in the MVVM mode, I modify the image in the viewmodel, and then bind it to the control. I zoom in/out the image before replacing, but when I replaced, I found that the new image didn't keep the zoom in/out, but in WPF it kept the zoom in/out, and I guess the control seemed to be reset when the image property method changed, so if I wanted to keep the zooming effect, how do I get this state in the viewmodel and apply it to the new image? At the same time, I found another interesting thing, for example, I want to change the black in the image to white, I wrote a These two phenomena confuse me and seem to be the opposite. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It does by default, but if you using
Because any change to image pixels will not trigger a render. After your modifications you must call
Zoom change always re-render the control. |
Beta Was this translation helpful? Give feedback.
It does by default, but if you using
AutoZoomToFit
orConstrainZoomOutToFitLevel
totrue
it's expected to affect zoom after replace image.Because any change to image pixels will not trigger a render. After your modifications you must call
LayerImage.TriggerRender()
orLayerImage.InvalidateVisual()
Zoom change always re-render the control.