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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:12:39+00:00 2026-06-16T18:12:39+00:00

From this post i came to know that there exist some platform improvements for

  • 0

From this post i came to know that there exist some platform improvements for
implementing pinch and zoom functionality. By using this new method(ManipulationDeltaEventArgs.PinchManipulation) how i can implement pinch to zoom functionality in windows phone.

Apart from this i need to implement scrolling feature too to the image control. In my current implementation, i am using Toolkit(gesture listener) for pinch and zoom functionality along with scroll viewer, now it seem both scrolling and and pinching events are overlapping and hence it produces a bad user experience.

Can anyone help me to solve this issue in my application. I am looking some code samples that help me to achieve the functionality.

I am not expected to get Multi touch behavior(codeplex) as answer. The assemblies using in the project are quite old and i heard that many of them are facing issues with marketplace submission only because of this.

  • 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-16T18:12:40+00:00Added an answer on June 16, 2026 at 6:12 pm

    As I said in my previous answer if you’re building a WP8 exclusive app you can use the new ManipulationDeltaEventArgs.PinchManipulation for pinch & zoom effects. Here’s a basic example of how to use ManipulationDeltaEventArgs.PinchManipulation data to scale, move and rotate an image.

    First, we’ll create a basic image hovering in the middle of a grid:

    <Grid x:Name="ContentPanel">
        <Image Source="Assets\Headset.png" 
               Width="200" Height="150"
               ManipulationDelta="Image_ManipulationDelta"
               x:Name="img"
               >
            <Image.RenderTransform>
                <CompositeTransform CenterX="100" CenterY="75" />
            </Image.RenderTransform>
        </Image>
    </Grid>
    

    Next, we’ll handle the ManipulationDelta event, check if it’s a Pinch Manipulation and apply the correct Silverlight transformations on our UIElement.

    private void Image_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
    {
        if (e.PinchManipulation != null)
        {
            var transform = (CompositeTransform)img.RenderTransform;
    
            // Scale Manipulation
            transform.ScaleX = e.PinchManipulation.CumulativeScale;
            transform.ScaleY = e.PinchManipulation.CumulativeScale;
    
            // Translate manipulation
            var originalCenter = e.PinchManipulation.Original.Center;
            var newCenter = e.PinchManipulation.Current.Center;
            transform.TranslateX = newCenter.X - originalCenter.X;
            transform.TranslateY = newCenter.Y - originalCenter.Y;
    
            // Rotation manipulation
            transform.Rotation = angleBetween2Lines(
                e.PinchManipulation.Current, 
                e.PinchManipulation.Original);
    
            // end 
            e.Handled = true;
        }
    }
    
    // copied from http://www.developer.nokia.com/Community/Wiki/Real-time_rotation_of_the_Windows_Phone_8_Map_Control
    public static double angleBetween2Lines(PinchContactPoints line1, PinchContactPoints line2)
    {
        if (line1 != null && line2 != null)
        {
            double angle1 = Math.Atan2(line1.PrimaryContact.Y - line1.SecondaryContact.Y,
                                       line1.PrimaryContact.X - line1.SecondaryContact.X);
            double angle2 = Math.Atan2(line2.PrimaryContact.Y - line2.SecondaryContact.Y,
                                       line2.PrimaryContact.X - line2.SecondaryContact.X);
            return (angle1 - angle2) * 180 / Math.PI;
        }
        else { return 0.0; }
    }
    

    Here’s what we did:

    • Scaling: PinchManipulation actually tracks scaling for us, so all we had to do is apply PinchManipulation.CumulativeScale to the scaling factor.
    • Transform: PinchManipulation tracks the original center and the new center (calculated between the two touch points). By subtracting the new center from the old center we can tell how much the UIElement needs to move and apply that to a translate transform. Note that a better solution here would also account for multiple Manipulation sessions by tracking cumulative original centers which this code doesn’t.
    • Rotation: We figured out the angle between the two touch points and applied it as the rotation transform. More on that in this Nokia wiki article @ Real-time rotation of the Windows Phone 8 Map Control

    Here’s a few print screens showing this code runs just fine:

    Untouched image
    Rotated, transformed and scaled image
    Rotated, transformed and scaled image

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

Sidebar

Related Questions

I came to know from this post that JB supports TLSv1.2. Now I am
I am getting this ambiguous reference error with some software that came from a
While browsing I came across this blog post about using the Wikipedia API from
From this post : I would first suggest that you optimize your dependentObservable (a.k.a.
I have learnt from this post that always use <a> tags or <button> tags
For some time I am worknig in MVC, I learnt from this post, http://evolpin.wordpress.com/2011/04/12/asp-net-mvc-partialview-with-ajax/#comment-435
Should be an easy one. I thought, from reading this blog post that I
Kicking around some small structures while answering this post , I came across the
All are from this post . What does these statement mean: error(nargchk(5, 6, nargin));
This is a separate question stemming from this post: How to use the filename

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.