public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (targetType != typeof(ImageSource))
            {
                throw new InvalidOperationException("Invalid target type.");
            }

            try
            {
                /*
                 *  Image image = new Image();
                 *  Stream stream = new MemoryStream(byteArray);
                 *  image.Source = ImageSource.FromStream(stream);
                 */
                Uri         uri       = new Uri(value.ToString());
                ImageSource imgSource = UriImageSource.FromUri(uri);
                return(imgSource);
                //return ImageSource.FromUri(new Uri(value.ToString(), UriKind.RelativeOrAbsolute));
                //return GetImageStreamFromURL(value.ToString());
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Beispiel #2
0
        public App()
        {
            var content = new ContentPage
            {
                Title   = "XamarinCircleImage",
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children        =
                    {
                        new Label {
                            HorizontalTextAlignment = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        },
                        new CircleImage
                        {
                            BorderColor       = Color.Red,
                            BorderThickness   = 5,
                            HeightRequest     = 150,
                            WidthRequest      = 150,
                            Aspect            = Aspect.AspectFill,
                            HorizontalOptions = LayoutOptions.Center,
                            Source            = UriImageSource.FromUri(new Uri("http://www.xamarintr.com/Portals/0/Users/003/03/3/yigit-ozaksut.jpg"))
                        }
                    }
                }
            };

            //MainPage = new NavigationPage(content);
            MainPage = new CircleSample();
        }
        public SpeakerPage()
        {
            InitializeComponent();
            viewModel      = App.SimpleIoC.Resolve <SpeakersViewModel> ();
            BindingContext = viewModel;

            if (viewModel.CurrentSpeaker.HeadshotUrl.Length > 0)
            {
                try
                {
                    var photo = new CircleImage
                    {
                        BorderColor       = Color.White,
                        BorderThickness   = 3,
                        HeightRequest     = 75,
                        WidthRequest      = 75,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri(viewModel.CurrentSpeaker.HeadshotUrl))
                                            //Source = UriImageSource.FromFile("TeamMirMaheed")
                                            //Source = UriImageSource.FromUri (new Uri ("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
                    };
                    stackCircles.Children.Clear();
                    stackCircles.Children.Add(photo);
                }
                catch (Exception exc)
                {
                }
            }
        }
Beispiel #4
0
 protected override void OnAppearing()
 {
     try
     {
         txt_nav_username.Text = Application.Current.Properties["username"].ToString().ToUpper();
         if (Application.Current.Properties["role"].ToString() == "Student")
         {
             try
             {
                 if (Application.Current.Properties["userno"].ToString().Length > 1)
                 {
                     img_nav_photo.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.GetPhotoAddress(Application.Current.Properties["campus"].ToString()) +
                                                                           Application.Current.Properties["userno"] + "_photo.jpg"));
                 }
                 else
                 {
                     img_nav_photo.Source = "no_photo.png";
                 }
             }
             catch (Exception)
             {
                 img_nav_photo.Source = "no_photo.png";
             }
         }
         else
         {
             img_nav_photo.Source = "no_photo.png";
         }
     }
     catch (Exception) { }
     base.OnAppearing();
 }
 protected override void OnAppearing()
 {
     if (role_value == "Student")
     {
         img_profilepic.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.GetPhotoAddress(campus_value) + Application.Current.Properties["userno"] + "_photo.jpg"));
     }
     else
     {
         img_profilepic.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.MainCampusStaffPhotolink + Application.Current.Properties["userno"] + "_photo.jpg"));
     }
     base.OnAppearing();
 }
 private void CreatePicture()
 {
     new CircleImage
     {
         BorderColor       = Color.White,
         BorderThickness   = 3,
         HeightRequest     = 150,
         WidthRequest      = 150,
         Aspect            = Aspect.AspectFill,
         HorizontalOptions = LayoutOptions.Center,
         Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
     };
 }
Beispiel #7
0
        public ImageCirclePage()
        {
            InitializeComponent();

            Image = new CircleImage
            {
                BorderColor       = Color.White,
                BorderThickness   = 3,
                HeightRequest     = 150,
                WidthRequest      = 150,
                Aspect            = Aspect.AspectFill,
                HorizontalOptions = LayoutOptions.Center,
                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
            };
        }
        private void SetSpeakerCircles()
        {
            var speaker = (Speaker)BindingContext;

            var photo = new CircleImage {
                BorderColor       = Color.White,
                BorderThickness   = 4,
                HeightRequest     = 50,
                WidthRequest      = 50,
                Aspect            = Aspect.AspectFill,
                HorizontalOptions = LayoutOptions.Center,
                Source            = UriImageSource.FromUri(new Uri(speaker.HeadshotUrl))
            };

            stackCircles.Children.Add(photo);
        }
Beispiel #9
0
        protected override void OnBindingContextChanged()
        {
            CachedImage.Source = null;
            if (!(BindingContext is ArtistFlexLayoutViewModel item))
            {
                return;
            }

            var uri = ((UriImageSource)UriImageSource.FromUri(new System.Uri(item.ImageUrl)));

            uri.CachingEnabled = true;
            uri.CacheValidity  = new System.TimeSpan(365, 0, 0, 0);
            CachedImage.Source = uri;

            base.OnBindingContextChanged();
        }
        protected override void OnBindingContextChanged()
        {
            base.OnBindingContextChanged();

            var acquaintance = BindingContext as Acquaintance;

            NameLabel.Text    = acquaintance.DisplayLastNameFirst;
            CompanyLabel.Text = acquaintance.Company;
            TitleLabel.Text   = acquaintance.JobTitle;

            if (!string.IsNullOrEmpty(acquaintance.SmallPhotoUrl))
            {
                PictureImage.Source = UriImageSource.FromUri(new Uri(acquaintance.SmallPhotoUrl));
            }
            //else
            //	PictureImage.Source = "placeHolderProfileImage.png";
        }
Beispiel #11
0
        public InformacoesPage(InformacoesViewModel vm)
        {
            InitializeComponent();


            this.Title = "Informações";

            vm.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) =>
            {
                if (e.PropertyName == "Character")
                {
                    imgPhoto.Source = UriImageSource.FromUri(new Uri((BindingContext as InformacoesViewModel).Character.Thumbnail));
                }
            };

            BindingContext = vm;
            vm.LoadData();
        }
Beispiel #12
0
        public ImageCirclePage()
        {
            InitializeComponent();

            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Spacing         = 10,
                Padding         = 10,
                Children        =
                {
                    new CircleImage
                    {
                        BorderColor       = Color.Pink,
                        BorderThickness   = 3,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
                    },
                    new CircleImage
                    {
                        BorderColor       = Color.Purple,
                        BorderThickness   = 6,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/e/ed/Saguinus_tripartitus_-_Golden-mantled_Tamarin.jpg"))
                    },
                    new CircleImage
                    {
                        BorderColor       = Color.Yellow,
                        BorderThickness   = 9,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                    },
                }
            };
        }
Beispiel #13
0
        public static void ItemsSourcePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var panel = bindable as UniformImagePanel;
            var items = newValue as IList <string>;

            if (items == null || items.Count == 0)
            {
                return;
            }

            panel.Children.Clear();
            foreach (var item in items)
            {
                Image img = new Image();
                img.Aspect = Aspect.AspectFill;
                img.Source = UriImageSource.FromUri(new Uri(item + "-small_x150"));
                panel.Children.Add(img);
                img.GestureRecognizers.Add(panel.tapGestureRecognizer);
            }
            panel.InvalidateLayout();
        }
        private void SetSpeakerCircles()
        {
            var session   = (Session)BindingContext;
            var speakerID = session.Speaker_Id;

            if (speakerID != null)
            {
                var speaker = EventRepository.GetSpeaker(int.Parse(speakerID));
                if (speaker != null)
                {
                    var photo = new CircleImage {
                        BorderColor       = Color.White,
                        BorderThickness   = 4,
                        HeightRequest     = 100,
                        WidthRequest      = 100,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri(speaker.HeadshotUrl))
                    };
                    stackCircles.Children.Add(photo);
                }
            }
        }
        public FullProfile(string campus, string users_name, string phone, string email, string userno, string userrole)
        {
            InitializeComponent();

            if (userrole == "Student")
            {
                img_profilepic.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.GetPhotoAddress(campus) + Application.Current.Properties["userno"] + "_photo.jpg"));
            }
            else
            {
                img_profilepic.Source = "no_photo.png";
            }

            txt_profile_username.Text = "WELCOME  ::  " + users_name.ToUpper();

            campus_value = campus;
            regno_value  = userno;
            role_value   = userrole;

            txt_profile_username.Text = users_name.ToUpper();
            txt_profile_userno.Text   = regno_value;
            txt_profile_phone.Text    = phone;
            txt_profile_email.Text    = email;
        }
        public App()
        {
            CircleImage pink   = null;
            var         button = new Button
            {
                Text = "Change Colors"
            };

            button.Clicked += (sender, args) =>
            {
                if (pink.BorderColor == Color.Pink)
                {
                    pink.BorderThickness = 20;
                    pink.BorderColor     = Color.Maroon;
                    pink.FillColor       = Color.Pink;
                }
                else
                {
                    pink.BorderThickness = 3;
                    pink.BorderColor     = Color.Pink;
                    pink.FillColor       = Color.Olive;
                }
            };
            var stack = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Spacing         = 10,
                Padding         = 20,
                Children        =
                {
                    button,
                    (pink = new CircleImage
                    {
                        BorderColor = Color.Pink,
                        FillColor = Color.Olive,
                        BorderThickness = 3,
                        HeightRequest = 150,
                        WidthRequest = 150,
                        Aspect = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        //Source = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                    }),
                    new CircleImage
                    {
                        BorderColor       = Color.Purple,
                        FillColor         = Color.Transparent,
                        BorderThickness   = 6,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/e/ed/Saguinus_tripartitus_-_Golden-mantled_Tamarin.jpg"))
                    },
                    new CircleImage
                    {
                        BorderColor       = Color.Yellow,
                        FillColor         = Color.Yellow,
                        BorderThickness   = 9,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                    },
                }
            };

            // The root page of your application
            MainPage = new ContentPage
            {
                Content = stack
            };
        }
Beispiel #17
0
        // show the next card
        void ShowNextCard()
        {
            if (cards[0].IsVisible == false && cards[1].IsVisible == false)
            {
                Setup();
                return;
            }

            var topCard = cards[topCardIndex];

            topCardIndex = NextCardIndex(topCardIndex);

            if (itemIndex >= ItemsSource.Count)
            {
                itemIndex = 0;
            }

            // if there are more cards to show, show the next card in to place of
            // the card that was swipped off the screen
            if (itemIndex < ItemsSource.Count)
            {
                // push it to the back z order
                ((RelativeLayout)this.Content).LowerChild(topCard);

                // reset its scale, opacity and rotation
                topCard.Scale = BackCardScale;
                topCard.RotateTo(0, 0);
                topCard.TranslateTo(0, -topCard.Y, 0);

                // set the data
                //topCard.Name.Text = "Hungry? How about.. " + ItemsSource[itemIndex].Name;
                topCard.previewImagesLayout.Children.Clear();

                for (var index = 0; index < PreviewNumber; index++)
                {
                    var tempIcon = new CircleImage
                    {
                        HeightRequest = 50,
                        WidthRequest  = 50,
                        Aspect        = Aspect.AspectFill,
                        Source        = UriImageSource.FromUri(new Uri(ItemsSource[itemIndex].foodImages[index].thumbnailUri)),
                        ClassId       = itemIndex.ToString() + "_" + index.ToString()
                    };

                    var tapGestureRecognizer = new TapGestureRecognizer();
                    tapGestureRecognizer.Tapped += async(sender, e) =>
                    {
                        var      s            = (CircleImage)sender;
                        string[] temp         = s.ClassId.Split('_');
                        int      orderIndex   = Int32.Parse(temp[0]);
                        int      previewIndex = Int32.Parse(temp[1]);

                        await topCard.Photo.FadeTo(0, 250);

                        topCard.Photo.Source = ImageSource.FromUri(new Uri(ItemsSource[orderIndex].foodImages[previewIndex].fullSizeUri));
                        await topCard.Photo.FadeTo(1, 250);
                    };
                    tempIcon.GestureRecognizers.Add(tapGestureRecognizer);

                    topCard.previewImagesLayout.Children.Add(tempIcon);
                }

                if (ItemsSource[itemIndex].foodImages != null)
                {
                    Random rnd        = new Random();
                    int    thumbCount = ItemsSource[itemIndex].foodImages.Count;
                    topCard.Photo.Source = ImageSource.FromUri(new Uri(ItemsSource[itemIndex].foodImages[rnd.Next(0, thumbCount)].fullSizeUri));
                }


                topCard.searchFoodButton.Text = "Find " + ItemsSource[itemIndex].Name;


                topCard.IsVisible = true;
                itemIndex++;
            }
        }
Beispiel #18
0
 public static ImageSource getDefaultUserImage()
 {
     return(UriImageSource.FromUri(new Uri("http://icons.iconarchive.com/icons/custom-icon-design/pretty-office-2/72/man-icon.png")));
 }
        public UserProfile(string campus, string users_name, string phone, string email, string userno, string userrole)
        {
            InitializeComponent();

            if (userrole == "Student")
            {
                img_profilepic.Source = "no_photo.png";
                img_profilepic.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.GetPhotoAddress(campus) + Application.Current.Properties["userno"] + "_photo.jpg"));
            }
            else
            {
                img_profilepic.Source = "no_photo.png";
                img_profilepic.Source = UriImageSource.FromUri(new Uri(Libraries.MobileConfig.MainCampusStaffPhotolink + Application.Current.Properties["userno"] + "_photo.jpg"));
            }

            txt_profile_username.Text = "WELCOME  ::  " + users_name.ToUpper();

            campus_value     = campus;
            regno_value      = userno;
            role_value       = userrole;
            phone_value      = phone;
            email_value      = email;
            users_name_value = users_name;

            txt_profile_username.Text = users_name.ToUpper();
            txt_profile_userno.Text   = regno_value;
            txt_profile_phone.Text    = phone;
            txt_profile_email.Text    = email;

            if (userrole == "Student")
            {
                myList.FlowItemsSource = new List <MenuItemModel>
                {
                    new MenuItemModel("thumb_notifications.png", "Announcements"),
                    new MenuItemModel("thumb_results.png", "My Results"),
                    new MenuItemModel("thumb_register.png", "My Registration"),
                    new MenuItemModel("thumb_feespay.png", "Fees Payments"),
                    new MenuItemModel("thumb_timetables.png", "My Timetables"),
                    new MenuItemModel("thumb_attendance.png", "My Attendance"),
                    new MenuItemModel("thumb_passout.png", "My Passouts"),
                    new MenuItemModel("thumb_coursematerial.png", "Course Materials"),
                    new MenuItemModel("thumb_directory.png", "Campus Directory"),
                    new MenuItemModel("thumb_mob_opac.png", "Library Centre")
                };
            }
            else
            {
                myList.FlowItemsSource = new List <MenuItemModel>
                {
                    new MenuItemModel("thumb_notifications.png", "Announcements"),
                    new MenuItemModel("thumb_feespay.png", "Salary Info"),
                    new MenuItemModel("thumb_timetables.png", "My Timetables"),
                    new MenuItemModel("thumb_results.png", "Results Centre"),
                    new MenuItemModel("thumb_coursematerial.png", "Course Materials"),
                    new MenuItemModel("thumb_directory.png", "Campus Directory"),
                    new MenuItemModel("thumb_financials.png", "My Claims"),
                    new MenuItemModel("thumb_mob_opac.png", "Library Centre")
                };
            }
            myList.FlowUseAbsoluteLayoutInternally = true;
            myList.FlowColumnCount        = 2;
            myList.FlowRowBackgroundColor = Color.Transparent;
            myList.FlowColumnExpand       = FlowColumnExpand.Proportional;
        }
        //	public static IDisplayProfilePicture<????> ProfilePicture { get; private set; }

        //public static IFacebookIDInterface FacebookID { get; private set; }

        //async public Task<string> GetTheFacebookId ()
        //{

        //	return DependencyService.Get<IFacebookID> ().GetFacebookId();

        //}

        public ProfilePage()
        {
            var labelGrayStyle = new Style(typeof(Label))
            {
                Setters =
                {
                    new Setter {
                        Property = Label.TextColorProperty, Value = Color.Gray
                    }
                }
            };


            Resources = new ResourceDictionary();
            Resources.Add(labelGrayStyle);



            //		ProfilePicture = DependencyService.Get<IDisplayProfilePicture<????>.DisplayProfile (50,50,220,22);
            //		var profilePicture = ProfilePicture;

            //sync with .Result or Task.Run(() => coolMethods().Wait());

            //THIS SHOULD WORK
            //var _profileId = DependencyService.Get<IFacebookID> ().GetFacebookIdAsync ().Result;
            //this doesn't work and should be called on OnAppearing

            var _profileId = AppConstants.FBIdentityID;

            //string _profileId = AppConstants.FBIdentityID;
            Debug.WriteLine("profile_Id");
            Debug.WriteLine(String.Format("Porfile ID is {0}", _profileId));

            //			string _profileId = "423402";

            string URLLarge  = String.Format("http://graph.facebook.com/{0}/picture?type=large", _profileId);
            string URLNormal = String.Format("http://graph.facebook.com/{0}/picture?type=normal", _profileId);
            string URLSquare = String.Format("http://graph.facebook.com/{0}/picture?type=square", _profileId);
            string URLSmall  = String.Format("http://graph.facebook.com/{0}/picture?type=small", _profileId);

            string fullNameString = AppConstants.FBFullName;

            Label fullNameLabel = new Label {
                Text      = fullNameString,
                TextColor = Color.Black
            };

            //IMAGE - BOX IMAGE
            var webImage = new Image {
                Aspect = Aspect.AspectFit
            };

            webImage.Source = ImageSource.FromUri(new Uri(URLLarge));



            //IMAGES - CIRLCE-BOXES

            //var FBProfileUrl = new Uri (URLLarge);

            var circleProfileImage = new CircleImage {
                //Source =   ImageSource.FromUri (new Uri("http://graph.facebook.com/165706980572556/picture?type=normal"))
                //			Source = ImageSource.FromUri (new Uri (localFBString))
                //Source = localFBString
                Source            = UriImageSource.FromUri(new Uri(URLLarge)),
                BorderColor       = Color.Black,
                BorderThickness   = 1,
                HeightRequest     = 99,
                WidthRequest      = 99,
                Aspect            = Aspect.AspectFill,
                HorizontalOptions = LayoutOptions.Center
            };

            //			profileImage.SetBinding (Image.SourceProperty, "FullURIFBProfileUrl");



            //var webImage2 = new Image { Aspect = Aspect.AspectFit };
            //webImage2.Source = ImageSource.FromUri (new Uri (URLNormal));//new Uri ("http://graph.facebook.com/423402/picture?type=large"));

            //var webImage3 = new Image { Aspect = Aspect.AspectFit };
            //webImage3.Source = ImageSource.FromUri (new Uri (URLSquare)); //new Uri ("http://graph.facebook.com/423402/picture?type=small"));

            //var webImage4 = new Image { Aspect = Aspect.AspectFit };
            //webImage4.Source = ImageSource.FromUri (new Uri (URLSmall));//new Uri ("http://graph.facebook.com/423402/picture?type=normal"));

            //DELETE-webImage.Source = ImageSource.FromUri (new Uri ("https://xamarin.com/content/images/pages/forms/example-app.png"));
            //DELETE-webImage.Source = ImageSource.FromUri (new Uri ("http://graph.facebook.com/v2.2/423402/picture"));

            Label numPrayerRequests = new Label {
                Text = "Prayers: 30"
            };

            Label numMyPrayers = new Label {
                Text = "My Prayers: 25"
            };

            Label numMyThoughts = new Label {
                Text = "My Thoughts: 20"
            };

            Label numPeoplePrayingForMe = new Label {
                Text = "People Praying for me: 10"
            };

            Label numPrayersForMe = new Label {
                Text = "Number of Prayers for me: 100"
            };


            Label numPeopleThinkingOfMe = new Label {
                Text = "People Thinking of me: 20"
            };


            Label numThoughtsForMe = new Label {
                Text = "Number of Thoughts for me: 200"
            };

            Label numOfFriends = new Label {
                Text = "Friends: 20"
            };

            Label blank = new Label {
                Text = " "
            };

            Label blank2 = new Label {
                Text = " "
            };

            Label memberSince = new Label {
                Text = "Member since 2014"
            };


            StackLayout profileStackLayout = new StackLayout {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Start,
                Padding           = new Thickness(10, 25, 10, 5),
                Children          =
                {
                    //webImage, webImage2, webImage3, webImage4, fullNameLabel
                    //webImage, fullNameLabel
                    circleProfileImage, fullNameLabel
                }
            };


            StackLayout statsStackLayout = new StackLayout {
                //BackgroundColor = Color.Gray,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.StartAndExpand,
                Padding           = new Thickness(10, 15, 10, 10),
                Children          =
                {
                    numPrayerRequests,     numMyPrayers,    numMyThoughts,
                    blank,
                    numPeoplePrayingForMe, numPrayersForMe, numPeopleThinkingOfMe,numThoughtsForMe,
                    blank2,
                    numOfFriends,
                    memberSince
                }
            };

            Content = new StackLayout {
                //BackgroundColor = Color.Gray,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.StartAndExpand,
                //Padding = new Thickness (10, 25, 10, 10),
                Children =
                {
                    profileStackLayout, statsStackLayout
                }
            };
        }
Beispiel #21
0
        public static Page GetMainPage()
        {
            var speakButton = new Button
            {
                Text = "Speak"
            };

            var languageButton = new Button
            {
                Text = "Default Language"
            };

            var sliderPitch  = new Slider(0, 2.0, 1.0);
            var sliderRate   = new Slider(0, 2.0, Device.OnPlatform(.25, 1.0, 1.0));
            var sliderVolume = new Slider(0, 1.0, 1.0);

            var useDefaults = new Switch
            {
                IsToggled = false
            };

            speakButton.Clicked += (sender, args) =>
            {
                CrossSms.Current.SendSms("Hello there!", "+16024926689");
                var text = "The quick brown fox jumped over the lazy dog.";
                if (useDefaults.IsToggled)
                {
                    CrossTextToSpeech.Current.Speak(text);
                    return;
                }

                CrossTextToSpeech.Current.Speak(text,
                                                pitch: (float)sliderPitch.Value,
                                                speakRate: (float)sliderRate.Value,
                                                volume: (float)sliderVolume.Value,
                                                crossLocale: locale);
            };

            var vibrateButton = new Button
            {
                Text = "Vibrate"
            };

            var sliderVibrate = new Slider(0, 10000.0, 500.0);

            vibrateButton.Clicked += (sender, args) =>
            {
                //var v = DependencyService.Get<IVibrate>();
                //v.Vibration((int)sliderVibrate.Value);
                Refractored.Xam.Vibrate.CrossVibrate.Current.Vibration((int)sliderVibrate.Value);
            };


            var connectivityButton = new Button
            {
                Text = "Connectivity Test"
            };

            var connected = new Label
            {
                Text = "Is Connected: "
            };

            var connectionTypes = new Label
            {
                Text = "Connection Types: "
            };

            var bandwidths = new Label
            {
                Text = "Bandwidths"
            };

            var host = new Entry
            {
                Text = "127.0.0.1"
            };


            var host2 = new Entry
            {
                Text = "montemagno.com"
            };

            var port = new Entry
            {
                Text     = "80",
                Keyboard = Keyboard.Numeric
            };

            var canReach1 = new Label
            {
                Text = "Can reach1: "
            };

            var canReach2 = new Label
            {
                Text = "Can reach2: "
            };


            connectivityButton.Clicked += async(sender, args) =>
            {
                connected.Text  = CrossConnectivity.Current.IsConnected ? "Connected" : "No Connection";
                bandwidths.Text = "Bandwidths: ";
                foreach (var band in CrossConnectivity.Current.Bandwidths)
                {
                    bandwidths.Text += band.ToString() + ", ";
                }
                connectionTypes.Text = "ConnectionTypes:  ";
                foreach (var band in CrossConnectivity.Current.ConnectionTypes)
                {
                    connectionTypes.Text += band.ToString() + ", ";
                }

                try
                {
                    canReach1.Text = await CrossConnectivity.Current.IsReachable(host.Text) ? "Reachable" : "Not reachable";
                }
                catch (Exception ex)
                {
                }
                try
                {
                    canReach2.Text = await CrossConnectivity.Current.IsRemoteReachable(host2.Text, int.Parse(port.Text)) ? "Reachable" : "Not reachable";
                }
                catch (Exception ex)
                {
                }
            };


            languageButton.Clicked += async(sender, args) =>
            {
                var locales = CrossTextToSpeech.Current.GetInstalledLanguages();
                var items   = locales.Select(a => a.ToString()).ToArray();

                if (Device.OS == TargetPlatform.Android)
                {
                    DependencyService.Get <IDialogs>().DisplayActionSheet("Language", "OK",
                                                                          items,
                                                                          which =>
                    {
                        languageButton.Text = items[which];
                        locale = locales.ElementAt(which);
                    });
                }
                else
                {
                    var selected = await page.DisplayActionSheet("Language", "OK", null, items);

                    if (string.IsNullOrWhiteSpace(selected) || selected == "OK")
                    {
                        return;
                    }
                    languageButton.Text = selected;
                    locale = new CrossLocale {
                        Language = selected
                    };                                       //fine for iOS/WP
                }
            };


            var disposeButton = new Button
            {
                Text = "Dispose Me"
            };

            disposeButton.Clicked += (sender, args) =>
            {
                CrossConnectivity.Dispose();
                CrossTextToSpeech.Dispose();
            };


            page = new ContentPage
            {
                Content = new ScrollView
                {
                    Content = new StackLayout
                    {
                        Padding  = 40,
                        Spacing  = 10,
                        Children =
                        {
                            new Label {
                                Text = "Hello, Forms!"
                            },
                            new Label {
                                Text = "Pitch"
                            },
                            sliderPitch,
                            new Label {
                                Text = "Speak Rate"
                            },
                            sliderRate,
                            new Label {
                                Text = "Volume"
                            },
                            sliderVolume,
                            new Label {
                                Text = "Use Defaults"
                            },
                            useDefaults,
                            languageButton,
                            speakButton,
                            new Label {
                                Text = "Vibrate Length"
                            },
                            sliderVibrate,
                            vibrateButton,
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId()
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true)
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true, "hello")
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true, "hello", "world")
                            },
                            new Label {
                                Text = "Id: " + CrossDeviceInfo.Current.Id
                            },
                            new Label {
                                Text = "Model: " + CrossDeviceInfo.Current.Model
                            },
                            new Label {
                                Text = "Platform: " + CrossDeviceInfo.Current.Platform
                            },
                            new Label {
                                Text = "Version: " + CrossDeviceInfo.Current.Version
                            },
                            connectivityButton,
                            connected,
                            bandwidths,
                            connectionTypes,
                            host,
                            host2,
                            port,
                            canReach1,
                            canReach2,
                            disposeButton,
                            new StackLayout
                            {
                                HeightRequest = 300
                            },
                            new CircleImage
                            {
                                BorderColor       = Color.Pink,
                                BorderThickness   = 3,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
                            },
                            new CircleImage
                            {
                                BorderColor       = Color.Purple,
                                BorderThickness   = 6,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/e/ed/Saguinus_tripartitus_-_Golden-mantled_Tamarin.jpg"))
                            },
                            new CircleImage
                            {
                                BorderColor       = Color.Yellow,
                                BorderThickness   = 9,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                            }
                        }
                    }
                }
            };

            CrossConnectivity.Current.ConnectivityChanged += (sender, args) =>
            {
                page.DisplayAlert("Connectivity Changed", "IsConnected: " + args.IsConnected.ToString(), "OK");
            };

            return(page);
        }
        public ImageCirclePage()
        {
            InitializeComponent();

            CircleImage pink   = null;
            var         button = new Button
            {
                Text = "Change Colors"
            };

            button.Clicked += (sender, args) =>
            {
                if (pink.BorderColor == Color.Pink)
                {
                    pink.BorderThickness = 20;
                    pink.BorderColor     = Color.Maroon;
                }
                else
                {
                    pink.BorderThickness = 3;
                    pink.BorderColor     = Color.Pink;
                }
            };
            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Spacing         = 10,
                Padding         = 10,
                Children        =
                {
                    button,
                    (pink = new CircleImage
                    {
                        BorderColor = Color.Pink,
                        BorderThickness = 3,
                        HeightRequest = 150,
                        WidthRequest = 150,
                        Aspect = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
                    }),
                    new CircleImage
                    {
                        BorderColor       = Color.Purple,
                        BorderThickness   = 6,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/e/ed/Saguinus_tripartitus_-_Golden-mantled_Tamarin.jpg"))
                    },
                    new CircleImage
                    {
                        BorderColor       = Color.Yellow,
                        BorderThickness   = 9,
                        HeightRequest     = 150,
                        WidthRequest      = 150,
                        Aspect            = Aspect.AspectFill,
                        HorizontalOptions = LayoutOptions.Center,
                        Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                    },
                }
            };
        }
Beispiel #23
0
        void Setup()
        {
            // set the top card
            topCardIndex = 0;
            // create a stack of cards
            for (int i = 0; i < Math.Min(NumCards, ItemsSource.Count); i++)
            {
                if (itemIndex >= ItemsSource.Count)
                {
                    break;
                }
                var card = cards[i];
                //card.Name.Text = "Hungry? How about " + ItemsSource[itemIndex].Name;

                if (card.previewImagesLayout.Children.Count == 0)
                {
                    for (var index = 0; index < PreviewNumber; index++)
                    {
                        var tempIcon = new CircleImage
                        {
                            HeightRequest = 50,
                            WidthRequest  = 50,
                            Aspect        = Aspect.AspectFill,
                            Source        = UriImageSource.FromUri(new Uri(ItemsSource[itemIndex].foodImages[index].thumbnailUri)),
                            ClassId       = itemIndex.ToString() + "_" + index.ToString()
                        };

                        var tapGestureRecognizer = new TapGestureRecognizer();
                        tapGestureRecognizer.Tapped += async(sender, e) =>
                        {
                            var      s            = (CircleImage)sender;
                            string[] temp         = s.ClassId.Split('_');
                            int      orderIndex   = Int32.Parse(temp[0]);
                            int      previewIndex = Int32.Parse(temp[1]);

                            await card.Photo.FadeTo(0, 250);

                            card.Photo.Source = ImageSource.FromUri(new Uri(ItemsSource[orderIndex].foodImages[previewIndex].fullSizeUri));
                            await card.Photo.FadeTo(1, 250);
                        };
                        tempIcon.GestureRecognizers.Add(tapGestureRecognizer);

                        card.previewImagesLayout.Children.Add(tempIcon);
                    }
                }

                if (ItemsSource[itemIndex].foodImages != null)
                {
                    Random rnd        = new Random();
                    int    thumbCount = ItemsSource[itemIndex].foodImages.Count;
                    card.Photo.Source = ImageSource.FromUri(new Uri(ItemsSource[itemIndex].foodImages[rnd.Next(0, thumbCount)].fullSizeUri));
                }
                card.searchFoodButton.Text     = "Find " + ItemsSource[itemIndex].Name;
                card.searchFoodButton.Clicked += (sender, EventArgs) =>
                {
                    Button clickedButton = (Button)sender;
                    string name          = clickedButton.Text.Replace("Find ", "");
                    Device.OpenUri(new Uri(string.Format(yelpUrl, name)));
                };

                var    count      = Items.Count;
                Random random     = new Random();
                string randomFood = Items[random.Next(0, count)].Name;

                var randomTapGestureRecognizer = new TapGestureRecognizer();
                randomTapGestureRecognizer.Tapped += async(sender, e) =>
                {
                    var answer = await Application.Current.MainPage.DisplayAlert("Can't Choose?", "Random Generator Says... Eat " + randomFood, "Find Around Me", "Close");

                    if (answer)
                    {
                        Device.OpenUri(new Uri(string.Format(yelpUrl, randomFood)));
                    }
                };

                card.randomFoodButton.GestureRecognizers.Add(randomTapGestureRecognizer);

                card.IsVisible = true;
                card.Scale     = GetScale(i);
                card.RotateTo(0, 0);
                card.TranslateTo(0, -card.Y, 0);
                ((RelativeLayout)this.Content).LowerChild(card);
                itemIndex++;
            }
        }
Beispiel #24
0
        public static Page GetMainPage()
        {
            return(new NavigationPage(new Home()));

            var speakButton = new Button
            {
                Text = "Speak"
            };

            var languageButton = new Button
            {
                Text = "Default Language"
            };

            var sliderPitch  = new Slider(0, 2.0, 1.0);
            var sliderRate   = new Slider(0, 2.0, Device.OnPlatform(.25, 1.0, 1.0));
            var sliderVolume = new Slider(0, 1.0, 1.0);

            var useDefaults = new Switch
            {
                IsToggled = false
            };

            speakButton.Clicked += (sender, args) =>
            {
                //CrossSms.Current.SendSms("Hello there!", "+16024926689");
                var text = "The quick brown fox jumped over the lazy dog.";
                if (useDefaults.IsToggled)
                {
                    CrossTextToSpeech.Current.Speak(text);
                    return;
                }

                CrossTextToSpeech.Current.Speak(text,
                                                pitch: (float)sliderPitch.Value,
                                                speakRate: (float)sliderRate.Value,
                                                volume: (float)sliderVolume.Value,
                                                crossLocale: locale);
            };

            var vibrateButton = new Button
            {
                Text = "Vibrate"
            };

            var sliderVibrate = new Slider(0, 10000.0, 500.0);



            var connectivityButton = new Button
            {
                Text = "Connectivity Test"
            };

            var connected = new Label
            {
                Text = "Is Connected: "
            };

            var connectionTypes = new Label
            {
                Text = "Connection Types: "
            };

            var bandwidths = new Label
            {
                Text = "Bandwidths"
            };

            var host = new Entry
            {
                Text = "127.0.0.1"
            };


            var host2 = new Entry
            {
                Text = "montemagno.com"
            };

            var port = new Entry
            {
                Text     = "80",
                Keyboard = Keyboard.Numeric
            };

            var canReach1 = new Label
            {
                Text = "Can reach1: "
            };

            var canReach2 = new Label
            {
                Text = "Can reach2: "
            };


            connectivityButton.Clicked += async(sender, args) =>
            {
                connected.Text  = CrossConnectivity.Current.IsConnected ? "Connected" : "No Connection";
                bandwidths.Text = "Bandwidths: ";
                foreach (var band in CrossConnectivity.Current.Bandwidths)
                {
                    bandwidths.Text += band.ToString() + ", ";
                }
                connectionTypes.Text = "ConnectionTypes:  ";
                foreach (var band in CrossConnectivity.Current.ConnectionTypes)
                {
                    connectionTypes.Text += band.ToString() + ", ";
                }

                try
                {
                    canReach1.Text = await CrossConnectivity.Current.IsReachable(host.Text) ? "Reachable" : "Not reachable";
                }
                catch (Exception ex)
                {
                }
                try
                {
                    canReach2.Text = await CrossConnectivity.Current.IsRemoteReachable(host2.Text, int.Parse(port.Text)) ? "Reachable" : "Not reachable";
                }
                catch (Exception ex)
                {
                }
            };


            languageButton.Clicked += async(sender, args) =>
            {
                var locales = CrossTextToSpeech.Current.GetInstalledLanguages();
                var items   = locales.Select(a => a.ToString()).ToArray();

                if (Device.OS == TargetPlatform.Android)
                {
                    DependencyService.Get <IDialogs>().DisplayActionSheet("Language", "OK",
                                                                          items,
                                                                          which =>
                    {
                        languageButton.Text = items[which];
                        locale = locales.ElementAt(which);
                    });
                }
                else
                {
                    var selected = await page.DisplayActionSheet("Language", "OK", null, items);

                    if (string.IsNullOrWhiteSpace(selected) || selected == "OK")
                    {
                        return;
                    }
                    languageButton.Text = selected;
                    locale = new CrossLocale {
                        Language = selected
                    };                                       //fine for iOS/WP
                }
            };


            var disposeButton = new Button
            {
                Text = "Dispose Me"
            };

            disposeButton.Clicked += (sender, args) =>
            {
                CrossConnectivity.Dispose();
                CrossTextToSpeech.Dispose();
                CrossBattery.Dispose();
            };

            var getBatteryButton = new Button
            {
                Text = "Get Battery Stats"
            };

            var batteryLevel = new Label
            {
                Text = "Level?"
            };


            var batteryStatus = new Label
            {
                Text = "Status?"
            };

            var batteryChargeType = new Label
            {
                Text = "ChargeType?"
            };


            var batteryIsLow = new Label
            {
                Text = "IsLow"
            };

            getBatteryButton.Clicked += (sender, args) =>
            {
                batteryLevel.Text      = "Level: " + CrossBattery.Current.RemainingChargePercent;
                batteryStatus.Text     = "Status: " + CrossBattery.Current.Status.ToString();
                batteryChargeType.Text = "ChargeType: " + CrossBattery.Current.PowerSource.ToString();
                batteryIsLow.Text      = "IsLow: " + ((CrossBattery.Current.RemainingChargePercent <= 15) ? "YES" : "NO");
            };

            CrossBattery.Current.BatteryChanged += (sender, args) =>
            {
                batteryLevel.Text      = "Changed EVENT! Level: " + args.RemainingChargePercent;
                batteryStatus.Text     = "Status: " + args.Status.ToString();
                batteryChargeType.Text = "ChargeType: " + args.PowerSource.ToString();
                batteryIsLow.Text      = "IsLow: " + ((args.IsLow) ? "YES" : "NO");
            };

            var navigateLatLong = new Button
            {
                Text = "Navigate Lat Long"
            };

            navigateLatLong.Clicked += (sender, args) =>
            {
                CrossExternalMaps.Current.NavigateTo("Space Needle", 47.6204, -122.3491);
            };


            var navigateAddress = new Button
            {
                Text = "Navigate Address"
            };

            navigateAddress.Clicked += (sender, args) =>
            {
                CrossExternalMaps.Current.NavigateTo("Xamarin", "394 pacific ave.", "San Francisco", "CA", "94111", "USA", "USA");
            };

            var buttonContacts = new Button
            {
                Text = "Contacts"
            };

            buttonContacts.Clicked += (sender, args) =>
            {
                page.Navigation.PushAsync(new ContactsPage());
            };


            var buttonGetGPS = new Button
            {
                Text = "GetGPS"
            };

            var labelGPS = new Label
            {
                Text = "GPS goes here"
            };

            buttonGetGPS.Clicked += async(sender, args) =>
            {
                var locator = CrossGeolocator.Current;
                locator.DesiredAccuracy = 50;
                labelGPS.Text           = "Getting gps";

                var position = await locator.GetPositionAsync(timeout : 10000);

                if (position == null)
                {
                    labelGPS.Text = "null gps :(";
                    return;
                }
                labelGPS.Text = string.Format("Time: {0} \nLat: {1} \nLong: {2} \n Altitude: {3} \nAltitude Accuracy: {4} \nAccuracy: {5} \n Heading: {6} \n Speed: {7}",
                                              position.Timestamp, position.Latitude, position.Longitude,
                                              position.Altitude, position.AltitudeAccuracy, position.Accuracy, position.Heading, position.Speed);
            };

            page = new ContentPage
            {
                Content = new ScrollView
                {
                    Content = new StackLayout
                    {
                        Padding  = 40,
                        Spacing  = 10,
                        Children =
                        {
                            new Label {
                                Text = "Hello, Forms!"
                            },
                            new Label {
                                Text = "Pitch"
                            },
                            sliderPitch,
                            new Label {
                                Text = "Speak Rate"
                            },
                            sliderRate,
                            new Label {
                                Text = "Volume"
                            },
                            sliderVolume,
                            new Label {
                                Text = "Use Defaults"
                            },
                            useDefaults,
                            languageButton,
                            speakButton,
                            new Label {
                                Text = "Vibrate Length"
                            },
                            sliderVibrate,
                            vibrateButton,
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId()
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true)
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true, "hello")
                            },
                            new Label {
                                Text = "Generated AppId: " + CrossDeviceInfo.Current.GenerateAppId(true, "hello", "world")
                            },
                            new Label {
                                Text = "Id: " + CrossDeviceInfo.Current.Id
                            },
                            new Label {
                                Text = "Model: " + CrossDeviceInfo.Current.Model
                            },
                            new Label {
                                Text = "Platform: " + CrossDeviceInfo.Current.Platform
                            },
                            new Label {
                                Text = "Version: " + CrossDeviceInfo.Current.Version
                            },
                            connectivityButton,
                            connected,
                            bandwidths,
                            connectionTypes,
                            host,
                            host2,
                            port,
                            canReach1,
                            canReach2,
                            disposeButton,
                            new CircleImage
                            {
                                BorderColor       = Color.Pink,
                                BorderThickness   = 3,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
                            },
                            new CircleImage
                            {
                                BorderColor       = Color.Purple,
                                BorderThickness   = 6,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/e/ed/Saguinus_tripartitus_-_Golden-mantled_Tamarin.jpg"))
                            },
                            new CircleImage
                            {
                                BorderColor       = Color.Yellow,
                                BorderThickness   = 9,
                                HeightRequest     = 150,
                                WidthRequest      = 150,
                                Aspect            = Aspect.AspectFill,
                                HorizontalOptions = LayoutOptions.Center,
                                Source            = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/53/Golden_Lion_Tamarin_Leontopithecus_rosalia.jpg"))
                            },
                            getBatteryButton,
                            new Label {
                                Text = "Battery Level"
                            },
                            batteryLevel,
                            new Label {
                                Text = "Battery Status"
                            },
                            batteryStatus,
                            new Label {
                                Text = "Battery Charge Type"
                            },
                            batteryChargeType,
                            new Label {
                                Text = "Battery is low"
                            },
                            batteryIsLow,
                            navigateAddress,
                            navigateLatLong,
                            buttonContacts,
                            buttonGetGPS,
                            labelGPS
                        }
                    }
                }
            };

            CrossConnectivity.Current.ConnectivityChanged += (sender, args) =>
            {
                page.DisplayAlert("Connectivity Changed", "IsConnected: " + args.IsConnected.ToString(), "OK");
            };

            return(new NavigationPage(page));
        }
Beispiel #25
0
 private Image CreateImage(string path)
 {
     Controls.ImageViewExpand image = new Controls.ImageViewExpand();
     image.Source = UriImageSource.FromUri(new Uri(path));
     return(image);
 }