|
@@ -291,81 +291,5 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
|
Dispatcher.Invoke(Shutdown);
|
|
Dispatcher.Invoke(Shutdown);
|
|
}
|
|
}
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Gets the image.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="uri">The URI.</param>
|
|
|
|
- /// <returns>Image.</returns>
|
|
|
|
- /// <exception cref="System.ArgumentNullException">uri</exception>
|
|
|
|
- public Image GetImage(string uri)
|
|
|
|
- {
|
|
|
|
- if (string.IsNullOrEmpty(uri))
|
|
|
|
- {
|
|
|
|
- throw new ArgumentNullException("uri");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return GetImage(new Uri(uri));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Gets the image.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="uri">The URI.</param>
|
|
|
|
- /// <returns>Image.</returns>
|
|
|
|
- /// <exception cref="System.ArgumentNullException">uri</exception>
|
|
|
|
- public Image GetImage(Uri uri)
|
|
|
|
- {
|
|
|
|
- if (uri == null)
|
|
|
|
- {
|
|
|
|
- throw new ArgumentNullException("uri");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return new Image { Source = GetBitmapImage(uri) };
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Gets the bitmap image.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="uri">The URI.</param>
|
|
|
|
- /// <returns>BitmapImage.</returns>
|
|
|
|
- /// <exception cref="System.ArgumentNullException">uri</exception>
|
|
|
|
- public BitmapImage GetBitmapImage(string uri)
|
|
|
|
- {
|
|
|
|
- if (string.IsNullOrEmpty(uri))
|
|
|
|
- {
|
|
|
|
- throw new ArgumentNullException("uri");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return GetBitmapImage(new Uri(uri));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Gets the bitmap image.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="uri">The URI.</param>
|
|
|
|
- /// <returns>BitmapImage.</returns>
|
|
|
|
- /// <exception cref="System.ArgumentNullException">uri</exception>
|
|
|
|
- public BitmapImage GetBitmapImage(Uri uri)
|
|
|
|
- {
|
|
|
|
- if (uri == null)
|
|
|
|
- {
|
|
|
|
- throw new ArgumentNullException("uri");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var bitmap = new BitmapImage
|
|
|
|
- {
|
|
|
|
- CreateOptions = BitmapCreateOptions.DelayCreation,
|
|
|
|
- CacheOption = BitmapCacheOption.OnDemand,
|
|
|
|
- UriCachePolicy = new RequestCachePolicy(RequestCacheLevel.CacheIfAvailable)
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- bitmap.BeginInit();
|
|
|
|
- bitmap.UriSource = uri;
|
|
|
|
- bitmap.EndInit();
|
|
|
|
-
|
|
|
|
- RenderOptions.SetBitmapScalingMode(bitmap, BitmapScalingMode.Fant);
|
|
|
|
- return bitmap;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|