当前位置: 首页>>代码示例>>C#>>正文


C# Contact.GetPicture方法代码示例

本文整理汇总了C#中Contact.GetPicture方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.GetPicture方法的具体用法?C# Contact.GetPicture怎么用?C# Contact.GetPicture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contact的用法示例。


在下文中一共展示了Contact.GetPicture方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParticipantItemModel

 public ParticipantItemModel(Contact contact, string email)
 {
     this._Email = email;
     this._DisplayName = contact.DisplayName;
     this._ContactPicture = GetSourceImageFromContactPicture(contact.GetPicture());
     this._Paid = false;
 }
开发者ID:Alegege,项目名称:PayMe,代码行数:7,代码来源:ParticipantItemModel.cs

示例2: FormatJsonPhotos

        /// <summary>
        /// Formats contact photos to JSON string.
        /// </summary>
        /// <param name="con">Contact object</param>
        /// <returns>JSON string</returns>
        private static string FormatJsonPhotos(Contact con)
        {
            // we return single photo since contact object instance contains single picture only
            var photoStream = con.GetPicture();

            if (photoStream == null) {
                return "";
            }

            return String.Format("{{value:\"{0}\", type: \"data\", pref: false}}", GetImageContent(photoStream));
        }
开发者ID:Bettogc,项目名称:frenzyApp,代码行数:16,代码来源:ContactsHelper.cs

示例3: UpdateContactPictures

        public void UpdateContactPictures(Contact contactToUpdate, string email)
        {
            ContactPictureItemModel<string, byte[]> contact = this.GetContactPictureItem(email);

            if (contact != null)
            {
                contact.Value = GetByteArrayFromImageStream(contactToUpdate.GetPicture());
            }
            else
            {
                //ContactPictures.Add(email, GetByteArrayFromImageStream(contact.GetPicture()));
                ContactPictures.Add(new ContactPictureItemModel<string, byte[]>(email, GetByteArrayFromImageStream(contactToUpdate.GetPicture())));
            }
        }
开发者ID:Alegege,项目名称:PayMe,代码行数:14,代码来源:ContactPicturesViewModel.cs

示例4: AddPerson

        //returns false if the item already exists in the list
        public bool AddPerson(Contact contact)
        {
            ItemViewModel a = new ItemViewModel();

            BitmapImage img = new BitmapImage();
            System.IO.Stream imageStream = contact.GetPicture();

            if (imageStream == null)
            {
                img.SetSource(App.GetResourceStream(new Uri(@"Assets/AppBar/questionmark.png", UriKind.Relative)).Stream);

            }
            else
                img.SetSource(imageStream);
            a.ProfileBitMap = img;
            a.LineOne = contact.DisplayName;
            SaveToJpeg(imageStream, contact.DisplayName + ".jpg");

            // set name to be displayed in GUI
            string name = contact.DisplayName;
            if(name.Length >= 9){
                name = name.Substring(0,9);
            }
            a.Name = name;
            a.Amount = 0;
            a.LineTwo = "I am in dept to: ";
            // check if the item exists.
            foreach(ItemViewModel item in Items)
            {
                if (item.LineOne.Equals(a.LineOne))
                {
                    return false;
                }
            }
            // set different bg color of each item in the list.
            if (Items.Count % 2 == 0)
            {
                a.BgColor = "#7FBCD8";
            }
            else
            {
                a.BgColor = "#568EB1";
            }
            // set own profilePic if it exists
            if (PicOfMyself == null)
            {
                BitmapImage myPic = new BitmapImage();
                myPic.SetSource(App.GetResourceStream(new Uri(@"Assets/AppBar/questionmark.png", UriKind.Relative)).Stream);
                PicOfMyself = myPic;
            }
            a.PicOfMyself = PicOfMyself;
            this.Items.Add(a);
            return true;
        }
开发者ID:johnedvard,项目名称:Spleisekalkulator,代码行数:55,代码来源:MainViewModel.cs


注:本文中的Contact.GetPicture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。