Increase image in Xamarin forms

0

I'm doing an app with xamarin forms and in a content page I show an image, someone knows how I can do so that when you click on the image, it enlarges and you can zoom in, since the image is a map and It has information that is not visible to the naked eye, thank you.

    
asked by Lucho 24.10.2017 в 22:28
source

1 answer

1

The best way is like this:

    private void OnTapped(object sender, EventArgs e)
    {
        if (Content.Scale > MIN_SCALE)
        {
            RestoreScaleValues();
        }
        else
        {
            Content.AnchorX = Content.AnchorY = 0.5;
            Content.ScaleTo(MAX_SCALE, 250, Easing.CubicInOut);             
        }
    }


    void RestoreScaleValues()
    {
        Content.ScaleTo(MIN_SCALE, 250, Easing.CubicInOut);
        Content.TranslateTo(0.5, 0.5, 250, Easing.CubicInOut);

        currentScale = 1;

        Content.TranslationX = 0.5;
        Content.TranslationY = 0.5;

        xOffset = Content.TranslationX;
        yOffset = Content.TranslationY;
    }
    
answered by 18.12.2017 в 11:55