public void AddTabSticker(MessageCore.Sticker.StickerCategory cate)
 {
     StickerAPI.DownloadImage(cate.IconURL, (imageCateIcon) =>
     {
         TabItem a = new TabItem
         {
             Width   = 38,
             Height  = 38,
             Content = new TabSticker(cate, ChatPage.Instance),
             ToolTip = cate.Name
         };
         Image img  = new Image();
         img.Source = imageCateIcon;
         a.Header   = img;
         tabCrlSticker.Items.Add(a);
     });
 }
예제 #2
0
        private void loadStore() //load thumbnail of sticker
        {
            progressBar.Visibility      = Visibility.Visible;
            progressBarThumb.Visibility = Visibility.Visible;


            StickerAPI.DownloadImage(Cate.ThumbImg, (thumbImage) =>
            {
                progressBar.Visibility = Visibility.Hidden;
                imgPreview.Source      = thumbImage;
            });
            StickerAPI.DownloadImage(Cate.IconPreview, (iconPreviewImage) =>
            {
                progressBarThumb.Visibility = Visibility.Hidden;
                imgIconPreview.Source       = iconPreviewImage;
            });
            txtName.Text = Cate.Name;
        }
예제 #3
0
 private void loadSticker()
 {
     Animator.Animator anim = new Animator.Animator();
     anim.CountLimit = 10;
     anim.Interval   = TimeSpan.FromSeconds((double)Duration / 1000);
     if (UriSheet != null)
     {
         progressBar.Visibility = Visibility.Visible;
         StickerAPI.DownloadImage(UriSheet, (stickerSheet) =>
         {
             anim.ImageSource      = stickerSheet;
             anim.VerticalOffset   = Size;
             anim.HorizontalOffset = Size;
             anim.Clickable        = Clickable;
             anim.isRunWhenLoaded  = IsRunWhenLoaded;
             sticker.Children.Add(anim);
             progressBar.Visibility = Visibility.Hidden;
         });
     }
 }
예제 #4
0
 public static void Load(LoadedHandler loadedHandler)
 {
     new Task(() =>
     {
         List <StickerCategory> categories = StickerAPI.GetCategories();
         foreach (StickerCategory cate in categories)
         {
             LoadedCategories.TryAdd(cate.ID, cate);
             List <Sticker> stickers = StickerAPI.GetStickerCategory(cate.ID);
             foreach (Sticker sticker in stickers)
             {
                 LoadedStickers.TryAdd(sticker.ID, sticker);
                 cate.Stickers.Add(sticker);
             }
         }
         if (loadedHandler != null)
         {
             Application.Current.Dispatcher.Invoke(() => loadedHandler());
         }
     }).Start();
 }