Beispiel #1
0
        private async void showSequenceForFolder(StorageFolder sf, bool repeat)
        {
            if (stopSequence)
            {
                return;
            }

            IReadOnlyList <IStorageItem> snapList = await sf.GetItemsAsync();

            try
            {
                for (int i = 0; i < snapList.Count; i++)
                {
                    StorageFile currFile = await sf.GetFileAsync(snapList[i].Name);

                    BitmapImage bmpimg = await ImageController.GetImage(currFile);

                    sequenceElement.Source = bmpimg;
                    screensaverView.Source = bmpimg;

                    await Task.Delay(TimeSpan.FromMilliseconds(150));
                }
            }
            catch (Exception ex)
            {
                addMessage("exception caught in sequence: " + ex.Message);
            }

            if (repeat)
            {
                this.showSequenceForFolder(sf, repeat);
            }
        }
Beispiel #2
0
        public async Task <IAsyncInfo> GenerateGif(StorageFile file, int delay, bool repeat, List <StorageFile> sourceFiles)
        {
            List <byte[]> source = new List <byte[]>();

            foreach (StorageFile sf in sourceFiles)
            {
                source.Add(await ImageController.ReadFile(sf));
            }

            return(GenerateGif(file, delay, repeat, source));
        }
Beispiel #3
0
        public IAsyncInfo GenerateGif(StorageFile file, int delay, bool repeat, List <BitmapImage> sourceBitmaps)
        {
            List <byte[]> source = new List <byte[]>();

            foreach (BitmapImage bi in sourceBitmaps)
            {
                source.Add(ImageController.convertToBytes(bi));
            }

            return(GenerateGif(file, delay, repeat, source));
        }
Beispiel #4
0
 static public String ImageToBase64(BitmapImage image)
 {
     byte[] imagedata = ImageController.convertToBytes(image);
     return(ImageController.ImageToBase64(imagedata));
 }