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 3674448
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:51:23+00:00 2026-05-19T02:51:23+00:00

I am trying to have a scaled image in a ScrollViewer in my Windows

  • 0

I am trying to have a scaled image in a ScrollViewer in my Windows Phone 7 application. On the application page I define the controls like this:

        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Name="ImageScroller" HorizontalAlignment="Center" VerticalAlignment="Center">
            <layout:LayoutTransformer x:Name="LayoutTransformer">
                <layout:LayoutTransformer.LayoutTransform>
                    <ScaleTransform x:Name="ImageScale"/>
                </layout:LayoutTransformer.LayoutTransform>                    
                <Image x:Name="Image" Margin="4" Source="{Binding ImageSource}"  />
            </layout:LayoutTransformer>
        </ScrollViewer>

The LayoutTransformer class is coming from the Silverlight Extension project.

I have methods to handle the ZoomIn and ZoomOut events and I do the following there:

    private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
    {
        // Zoom In 
        ImageScale.ScaleX = ImageScale.ScaleY = ImageScale.ScaleX + 0.5;
        LayoutTransformer.ApplyLayoutTransform();
        ImageScroller.InvalidateMeasure();
    }

However when I have a Zoom-In and the Image is changed the ScrollView control has empty area at the bottom and at the right side of the Image. Almost as if the Image was scaled but clipped using the size of the original image before the scale transform.

Any ideas what I am doing wrong?

I also created a project that reproduces this problem: http://dl.dropbox.com/u/2598447/ZoomTest.WP7.zip

  • 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-05-19T02:51:23+00:00Added an answer on May 19, 2026 at 2:51 am

    I finally received some answer and hopefully a solution from David Anson of Microsoft. Here is his comment, but you can also read his answer on his blog:

    Your phone can turn into a robot – LayoutTransformer works great on the Windows Phone platform

    Thanks for the great demonstration!
    This problem turns out to be due to a
    limitation of Silverlight on Windows
    Phone 7 – that UI elements larger than
    2048×2048 get clipped to that size
    when being displayed. Here’s a link to
    some more information about the
    problem:

    stackoverflow.com/…/bitmapimage-size-restrictions-in-silverlight

    In your example, the test image is
    1201×1401 and I first notice clipping
    after 3 “Zoom In”s – which corresponds
    to a zoom factor of 1.9x – which
    translates to an effective image size
    of 2282×2662 – which exceeds the
    limits in both directions. Doing the
    math to compute the amount this
    exceeds 2048 gives 234 in the
    horizontal direction and 614 in the
    vertical. Now keep those numbers in
    mind and scroll all the way to the
    bottom-right of the ScrollViewer on
    your phone’s 480×800 screen. Note that
    the amount of horizontal black space
    is approximately half the screen width
    (i.e., ~240px) and the vertical black
    space is about three quarters of the
    screen height (i.e., 600px) – because
    these estimates match up so closely
    with the overages we’ve just computed,
    I’m fairly confident you’re running
    into this problem.

    Unfortunately, it’s a platform
    limitation (which you already
    confirmed by running your scenario
    successfully on desktop Silverlight)
    and therefore not something I can
    directly fix in LayoutTransformer.
    Fortunately, there are some
    workarounds which are discussed in the
    thread/link above.

    Sorry for the trouble – I hope this
    helps!

    Also there is a stackoverflow article is referenced in the answer describing the root cause of this problem as a Windows Phone 7 platform limitation:

    BitmapImage size restrictions in Silverlight

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

Sidebar

Related Questions

Am trying to have an image visually echo through from intro page to homepage~which
I have an ImageView that contains an image. This image is getting scaled to
I am trying to have a logout page where is displays a messages and
I'm trying to display an image using OpenCV. I have the following very basic
I'm trying to have an image scale to a certain size depending on the
I'm trying to scale a tiny image (something like 20x40 pixels) to an arbitrarily
I have an image I'm trying to use as a background in Android. The
Afternoon, I am trying have an HTML file containing a frameset which contains two
Trying to have my PHP script return some SQL table queries. Here's my script
I have a cache directory I'm trying to have ignored by git which lives

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.