Esempio n. 1
0
 public static ImageSource GetIconImageSource(this EmbeddedResourceManager manager, string resourceKey, int width, int height)
 {
     using (var icon = manager.GetIcon(resourceKey, width, height))
     {
         return(Win.Utility.WPFUtilities.ConvertIconToImageSource(icon));
     }
 }
Esempio n. 2
0
 public static Icon GetIcon(this EmbeddedResourceManager manager, string resourceKey, int width, int height)
 {
     if (width == -1)
     {
         return(new Icon(manager.GetStream(resourceKey)));
     }
     else
     {
         return(new Icon(manager.GetStream(resourceKey), width, height));
     }
 }
Esempio n. 3
0
 public static Image GetImage(this EmbeddedResourceManager manager, string resourceKey)
 {
     return(Image.FromStream(manager.GetStream(resourceKey)));
 }
Esempio n. 4
0
 public static ImageSource GetIconImageSource(this EmbeddedResourceManager manager, string resourceKey, int size)
 {
     return(manager.GetIconImageSource(resourceKey, size, size));
 }
Esempio n. 5
0
        //public static System.Windows.Media.ImageSource GetResourceAsImageSource(this GoldenLibrary.ResourceManagerBase manager, string resourceKey)
        //{
        //	var assemblyName = Assembly.GetAssembly(manager.GetType()).GetName().Name;
        //	var uri = new Uri(string.Concat(@"pack://application:,,,/", assemblyName, ";component/Resources/", resourceKey), UriKind.RelativeOrAbsolute);
        //	return new BitmapImage(uri);
        //}
        public static ImageSource GetImageSource(this EmbeddedResourceManager manager, string resourceKey)
        {
            var stream = manager.GetStream(resourceKey);

            return(Win.Utility.WPFUtilities.StreamToImageSource(stream));
        }
Esempio n. 6
0
 public static Icon GetIcon(this EmbeddedResourceManager manager, string resourceKey)
 {
     return(manager.GetIcon(resourceKey, -1));
 }