Skip to content

How to get the image status in viewmodel #951

Answered by sn4k3
howzew asked this question in Q&A
Discussion options

You must be logged in to vote

when I replaced, I found that the new image didn't keep the zoom in/out

It does by default, but if you using AutoZoomToFit or ConstrainZoomOutToFitLevel to true it's expected to affect zoom after replace image.

I want to change the black in the image to white, I wrote a changecolor method, when I use this method, the image does not change in any way.

Because any change to image pixels will not trigger a render. After your modifications you must call LayerImage.TriggerRender() or LayerImage.InvalidateVisual()

when I zoom in or out of the image, I find that the black in the image changes to white, that is, the image has actually been modified

Zoom change always re-render the control.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@howzew
Comment options

Answer selected by howzew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants