mircea21S / RichCanvas

Infinite canvas with panning, zooming, scrolling and other customizable functions, designed for MVVM
MIT License
167 stars 17 forks source link

The image automatically fits in the middle of the canvas #12

Open fanweiGit opened 2 years ago

fanweiGit commented 2 years ago

Hi, I want to realize that the picture automatically adapts to the canvas, so that the picture is in the middle of the canvas, is there a way to get the width and height of the RichItemsControl or other methods to achieve this function? whether I can do it with an extension method that changes coordinates similar to what ShouldBringIntoView does (as the MakeVisible method does) Trouble you again,Thank you so much. Best Wishes!

mircea21S commented 2 years ago

Hi, You should be able to get the ActualWidth and ActualHeight from the RichItemsControl. Also you can wrap your RichItemsControl in another Panel or any other object and use that size.

Anyway, I will expose a property on RichItemsControl to see the current Viewport size.

Thanks.