Esempio n. 1
0
        private async Task ChangeToMetaImage(Record record, string path,
                                             double?zoomFactor, double width, double height)
        {
            using (var meta = new MetaImage())
            {
                await Task.Run(() =>
                {
                    if (record != null)
                    {
                        meta.LoadImage(record);
                    }
                    else
                    {
                        meta.LoadImage(path);
                    }
                    //return meta.DecodeImage(null, width, height);
                });

                var image = await(zoomFactor.HasValue
                   ? meta.DecodeImageAsync(zoomFactor, null, null)
                   : meta.DecodeImageAsync(null, width, height));

                this.ChangeSource(image, meta.Path, false);
                return;
            }
        }
Esempio n. 2
0
        private async Task DecodeMetaImage(Record record, double zoomFactor)
        {
            if (record == null)
            {
                return;
            }

            if (core.MetaImageExtention.Contains(System.IO.Path.GetExtension(record.FileName).ToLower()))
            {
                using (var meta = new MetaImage())
                {
                    await Task.Run(() =>
                    {
                        meta.LoadImage(record);
                    });

                    var image = await meta.DecodeImageAsync(zoomFactor, null, null);

                    this.ChangeSource(image, meta.Path, false);
                    return;
                }
            }
        }