Exemple #1
0
        private void GenerateThumbnail(MultimediaLinkViewModel item, int maxDimension)
        {
            string filename = _tempFileManager.GetContentFileName(item.MultimediaID, item.Extension);

            item.TempFilename = filename;
            this.InvokeIfRequired(() => {
                item.Thumbnail = GraphicsUtils.GenerateThumbnail(filename, maxDimension);
            });
        }
Exemple #2
0
        private void ViewMultimedia(MultimediaLinkViewModel selected)
        {
            var filename = _tempFileManager.GetContentFileName(selected.MultimediaID, selected.Extension);

            if (!string.IsNullOrWhiteSpace(filename))
            {
                SystemUtils.ShellExecute(filename);
            }
        }
 private void DisplayMultimedia(MultimediaLinkViewModel selected)
 {
     if (selected != null)
     {
         JobExecutor.QueueJob(() => {
             string filename = _tempFileManager.GetContentFileName(selected.MultimediaID, selected.Extension);
             var image       = GraphicsUtils.LoadImageFromFile(filename);
             imgPreview.InvokeIfRequired(() => {
                 imgPreview.Stretch          = Stretch.Uniform;
                 imgPreview.StretchDirection = StretchDirection.DownOnly;
                 imgPreview.Source           = image;
                 gridInfo.DataContext        = image;
                 FileInfo f           = new FileInfo(filename);
                 lblImageInfo.Content = string.Format("{0}x{1}  {2} DPI  {3}", image.PixelWidth, image.PixelHeight, image.DpiX, ByteLengthConverter.FormatBytes(f.Length));
             });
         });
     }
     else
     {
         imgPreview.Source    = null;
         lblImageInfo.Content = "";
     }
 }