private void LoadDocument() { _slideList = new List <SlidePage>(); int index = 0; foreach (var item in this._pptDocument.List) { byte [] imgContents = Convert.FromBase64String(item.ImageAsText); BitmapFactory.Options opt = new BitmapFactory.Options(); opt.InSampleSize = 1; opt.InPurgeable = true; opt.InDither = true; Bitmap bitmap = BitmapFactory.DecodeByteArray(imgContents, 0, imgContents.Length, opt); SlidePage page = new SlidePage(); page.Image = bitmap; page.Memo = item.Note.Replace('\r', '\n'); page.Id = index; page.AnimationCount = item.AnimationCount; page.AnimationRemains = page.AnimationCount; index++; _slideList.Add(page); } }
private void LoadDocument() { this.Slides = new System.Collections.ObjectModel.ObservableCollection <SlidePage>(); int slideIndex = 1; foreach (var item in this.Application.Document.List) { byte[] imgContents = Convert.FromBase64String(item.ImageAsText); MemoryStream ms = new MemoryStream(imgContents); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.SetSource(ms); ms.Dispose(); SlidePage page = new SlidePage(); page.Image = bitmapImage; page.Memo = item.Note; page.AnimationRemains = item.AnimationCount; SlideItemData tagData = new SlideItemData(); tagData.AnimationCount = item.AnimationCount; tagData.SlideIndex = slideIndex; page.TagData = tagData; this.Slides.Add(page); slideIndex++; } StartShow(); SetSelectedBorder(1); }
void panorama_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count == 0) { return; } SlidePage slidePage = (e.AddedItems[0] as SlidePage); SlideItemData tagData = slidePage.TagData; slidePage.AnimationRemains = tagData.AnimationCount; int slideIndex = tagData.SlideIndex; SetSlide(slideIndex, tagData.AnimationCount); SetSelectedBorder(slideIndex); }
void DoubleTap() { if (_countOfAnimation <= _currentAnimation) { return; } if (_animationLock == true) { return; } _animationLock = true; SlidePage currentPage = this.SlideList[this.CurrentSlideIndex]; currentPage.AnimationRemains--; string url = string.Format("http://{0}:{1}/nextAnimation", _ip, _port); App.CallUrl(url, SetAnimationCompleted, null); }
void SetNextAnimation() { if (countOfAnimation <= currentAnimation) { return; } if (_animationLock == true) { return; } _animationLock = true; SlidePage currentPage = (panorama.SelectedItem as SlidePage); currentPage.AnimationRemains--; System.Diagnostics.Debug.WriteLine("AniStart: " + _animationLock); string url = string.Format("http://{0}:{1}/nextAnimation", _ipAddress, _port); App.CallUrl(url, SetAnimationCompleted, null); }