Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9260057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:48:06+00:00 2026-06-18T12:48:06+00:00

I am having trouble with a zoom in button on my scrollviewer. Inside of

  • 0

I am having trouble with a zoom in button on my scrollviewer.

Inside of the viewer is a grid. And inside of that grid is a bunch of images laid out in a specific ordering. Ideally I would like to go from image to image by a button click, and I have acheived this. I have a functioning zoom out button, but when I zoom in…it does not scroll to where I want it to. I use the margin of the image to scroll to it.

The problem I seem to be having is that the scrollable height and width do not update.

When zoom out is pressed, I call:

zoomFactor = 1;
rosaryScroll.ZoomToFactor(zoomFactor);
rosaryScroll.InvalidateScrollInfo();
setRosaryState(rosaryState);

Set rosary state scrolls to a particular image in the viewer by using its margin and the size of the scrollviewer to center the image onto the scroll viewer.

rosaryScroll.ScrollToHorizontalOffset(
     (selectedBead.Margin.Left
     + (selectedBead.Width / 2)
     + rosaryScroll.Margin.Left / 2)
     * zoomFactor);
rosaryScroll.ScrollToVerticalOffset(
     (selectedBead.Margin.Top
     - (selectedBead.Height / 2)
     - rosaryScroll.Margin.Top / 2)
     * zoomFactor);

When I zoom out (zoomFactor was 5), the scrollable height/width are fine and easy to scroll around.
rosaryScroll.ScrollableHeight= 2336.0 double
rosaryScroll.ScrollableWidth= 2584.0 double

But when I zoom in (zoomFactor was 1), the scrollable height/width remain very small
rosaryScroll.ScrollableHeight= 84.0 double
rosaryScroll.ScrollableWidth= 0.0 double

So how can I update this Scrollable Height and Width after my zoom call? InvalidateScrollInfo() seems to be ineffective…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:48:07+00:00Added an answer on June 18, 2026 at 12:48 pm

    I’d consider giving up on using a ScrollViewer and roll-out your own solution based on manipulation events and render transforms. As you noticed – ScrollViewer isn’t written for easy programmatic manipulation and it is going to make it hard for you to implement any custom behavior that it wasn’t designed for. The properties don’t update immediately upon request and you might need to wait for some events (e.g. ViewChanged) before you see the new values. You could try using the extensions I wrote to animate the offset and zoom factor values, but be warned that these are a bit hacky and some people had problems with their behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be easy, but I'm having trouble figuring out how to zoom an
I'm having trouble spacing out my navigation bar evenly across the 4 column grid.
Having trouble understanding how to filter an images table by tag information in a
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
I'm having trouble understanding how to create relationships between classes on a project that
i have a menu that i generated on purecssmenu.com and im having trouble trying
I am having a little trouble getting my page that has the width 900px
I'm having trouble with zooming TIFF images loaded into a QGraphicsView with QGraphicsPixmapItem .
I am trying to add some functionality that will zoom the map in/out depending
Having trouble with the examples for the .RowStart method. Comparing the 2 syntaxes: http://www.jeremyskinner.co.uk/2009/03/01/mvccontrib-grid-part-5-the-action-syntax/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.