How To zoom image in mono android with multitouch?

mshkordmshkord IQMember
edited October 2012 in Xamarin.Android

Im new in android and I want zoom in/ Zoom Out image.
please help me to do it!
thanks

Posts

  • The user and all related content has been deleted.
  • CTCHANGCTCHANG AUMember ✭✭

    Perhap you may consider using the WebView control, as it have the multi-touch zoom in/out implemented. All you need is load your image into the WebView control.

  • mshkordmshkord IQMember

    thanks.
    but scroll view sample for ios not android.
    please help me.

  • TakeshichTakeshich JPMember

    Implemented. Please refer to the following link.
    http://pastebin.com/QsG9AYPb

  • mshkordmshkord IQMember

    thanks takeshine.

  • CodeMonkeyCodeMonkey GBMember ✭✭✭

    This can be done using the WebView, see this code:

     WebView view = FindViewById<WebView>(Resource.Id.myWebView);
    
                    if (view != null)
                    {
                        String imageUrl = "file:///android_asset/SomeSampleImage.png";
                        view.Settings.DefaultZoom = WebSettings.ZoomDensity.Far;
                        view.Settings.SetSupportZoom(true);
                        view.Settings.BuiltInZoomControls = true;
                        view.LoadUrl(imageUrl);
                    }
    

    'SomeSampleImage.png' is the image you want to show and it should be contained within your Assets folder with a build action of AndroidAsset.

  • DharmaRaoDharmaRao USMember

    Hi,

    How to enable zoom on a scrollview? i didn't find the Minimum and maximum scale properties in xamarin.forms, where as it is available in xamarin. help me anyone if you are aware of this.

    Thanks!

Sign In or Register to comment.