In my graphics application, there is canvas area that has some graph. The scrollbars associated with the x- cordinate and y-cordinate must be in sync with this viewport area of the canvas (where the graph is present). When a user clicks on a zoom button the graph is zoomed in and out. Now the problem is setting the scrollbar for this zooming. On zoomin in or out, the viewport of the scrollbar should be in sync with the percentage of zoom.
How to set the thumb size of the scrollbar in this case. I have the Maximum , Minimum and Value property of the scrollbar and the entire graph width and height with the zoomfactor.
How should I set the ViewportSize or the thumb size of the scrollbar?
I used the below code snippet to get the ViewportSize but its not accurate
mScrollBarY.ViewportSize = (double)yAxis.CurrentValueRange;
where the CurrentValueRange gives the zoomed in visible range.