protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RequestWindowFeature (WindowFeatures.NoTitle); SetContentView(Resource.Layout.view_list_image_url_layout); string filePath = ""; if (this.Intent.Extras != null) { if (this.Intent.Extras.ContainsKey (constants.kFilePath)) { filePath = this.Intent.Extras.GetString (constants.kFilePath); } } //var progressDialog = ProgressDialog.Show (this, "", "", true); //progressDialog.SetInverseBackgroundForced (true); //progressDialog.SetContentView(new ProgressBar(this)); //progressDialog.SetCancelable (true); //progressDialog.SetCanceledOnTouchOutside (true); // Get our button from the layout resource, // and attach an event to it imageView = FindViewById<MultiImageView>(Resource.Id.imgURL); // Sets images for the slider icons and their size imageView.SliderSelectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_grn); imageView.SliderUnselectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_trans); imageView.SetSliderIconDimensions(30, 30); // Sets an image for the Magnify button (and its size) in the top left and enables the ZoomImage event imageView.MagnifyIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.ic_close_large); imageView.SetMagnifyIconDimensions(100, 100); imageView.MagnifyEnabled = true; // I want to show pictures in the imageview that are online, giving the MultiImageView a list of URLs to download at SampleSize 2 (2x scaled down) imageView.DownloadedImageSampleSize = 2; string[] arrPath = {filePath}; // imageView.LoadImageList(new [] { // "" // }); imageView.LoadImageList(arrPath); // Adding eventhandlers for when an image is loaded so I can update the imageview to show its images, and an eventhandler for when the Magnify button is pressed imageView.ImagesLoaded += (sender, e) => { // Loads the first image in the list RunOnUiThread(imageView.LoadImage); //progressDialog.Dismiss(); }; imageView.ZoomImageEvent += (sender, e) => { // Fire whatever code you want to happen on a Magnify click //imageView.SetScaleType(ImageView.ScaleType.FitXy); Finish(); }; }
//public void getPhotos(int idd) { // var url = "http://192.168.17.1:5000/getPhotos/" + idd.ToString(); //var client = new RestClient(url); //var request = new RestRequest(Method.GET); //client.ExecuteAsync<PhObject>(request, response => //{ // var ph = response.Data.Items; //photocall(response.Data.Items); // }); //} public void photocall(List <photoItem> li) { var photoarray = li.Select(item => item.photo).ToArray(); image.LoadImageList(photoarray); image.SliderSelectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_grn); image.SliderUnselectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_trans); image.SetSliderIconDimensions(50, 50); image.DownloadedImageSampleSize = 1; var myActivity = (ItemContext)this.Activity; image.ImagesLoaded += (sender, e) => { // Loads the first image in the list myActivity.RunOnUiThread(image.LoadImage); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it imageView = FindViewById<MultiImageView>(Resource.Id.imageView1); // Sets images for the slider icons and their size imageView.SliderSelectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_grn); imageView.SliderUnselectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_trans); imageView.SetSliderIconDimensions(30, 30); // Sets an image for the Magnify button (and its size) in the top left and enables the ZoomImage event imageView.MagnifyIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.Magnify); imageView.SetMagnifyIconDimensions(70, 70); imageView.MagnifyEnabled = true; // I want to show pictures in the imageview that are online, giving the MultiImageView a list of URLs to download at SampleSize 2 (2x scaled down) imageView.DownloadedImageSampleSize = 2; imageView.LoadImageList(new [] { "http://blog.xamarin.com/wp-content/uploads/2013/01/evolve-badge.png", "http://oi50.tinypic.com/dfzo0k.jpg", "http://oi49.tinypic.com/kd6fcp.jpg" }); // Adding eventhandlers for when an image is loaded so I can update the imageview to show its images, and an eventhandler for when the Magnify button is pressed imageView.ImagesLoaded += (sender, e) => { // Loads the first image in the list RunOnUiThread(imageView.LoadImage); }; imageView.ZoomImageEvent += (sender, e) => { // Fire whatever code you want to happen on a Magnify click }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it imageView = FindViewById <MultiImageView>(Resource.Id.imageView1); // Sets images for the slider icons and their size imageView.SliderSelectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_grn); imageView.SliderUnselectedIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.slider_blt_trans); imageView.SetSliderIconDimensions(30, 30); // Sets an image for the Magnify button (and its size) in the top left and enables the ZoomImage event imageView.MagnifyIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.Magnify); imageView.SetMagnifyIconDimensions(70, 70); imageView.MagnifyEnabled = true; // I want to show pictures in the imageview that are online, giving the MultiImageView a list of URLs to download at SampleSize 2 (2x scaled down) imageView.DownloadedImageSampleSize = 2; imageView.LoadImageList(new [] { "http://blog.xamarin.com/wp-content/uploads/2013/01/evolve-badge.png", "http://oi50.tinypic.com/dfzo0k.jpg", "http://oi49.tinypic.com/kd6fcp.jpg" }); // Adding eventhandlers for when an image is loaded so I can update the imageview to show its images, and an eventhandler for when the Magnify button is pressed imageView.ImagesLoaded += (sender, e) => { // Loads the first image in the list RunOnUiThread(imageView.LoadImage); }; imageView.ZoomImageEvent += (sender, e) => { // Fire whatever code you want to happen on a Magnify click }; }