Source/Fusion/Core/Controls/Image.cs
/// <summary>
///		Gathers all images under the given resource directory and plays them over the given duration.
///		Assumes that images are named on the form Foo-1.png, Foo-2.png, ...., Foo-n.png
///		<todo>Probably need some more error handling. </todo>
/// </summary>
/// <param name="resourceDirectoryName">Where to look for images</param>
/// <param name="assembly">Assembly to find the embeded images resources</param>
/// <param name="duration">How long one loop lasts</param>
/// <param name="overlayColor">Tint all images with the provided color.</param>
/// <returns></returns>
Gathers all images under the given resource directory and plays them over the given duration.
Assumes that images are named on the form Foo-1.png, Foo-2.png, ...., Foo-n.png
Probably need some more error handling.
Gathers all images under the given resource directory and plays them over the given duration . Assumes that images are named on the form Foo - 1 . png Foo - 2 . png .... Foo - n . png Probably need some more error handling .
public static IControl Animation(string resourceDirectoryName, Assembly assembly, TimeSpan duration, IObservable<Color> overlayColor = null)
		{
			var resourceCache = _resourceCaches.GetOrAdd(assembly, a => a.GetManifestResourceNames().ToImmutableHashSet());
			var resources = resourceCache
				.Where(k => k.Contains(resourceDirectoryName))
				.ToImmutableSortedSet(new AnimationImageNameComparer())
				.Select(resource => new ImageStream(scaleFactor: 1, create: () => assembly.GetManifestResourceStream(resource)))
				.ToList();
			return Implementation.Animate(resources, duration, overlayColor);
		}
public static IControl Animation ( string resourceDirectoryName , Assembly assembly , TimeSpan duration , IObservable < Color > overlayColor = null ) { var resourceCache = _resourceCaches . GetOrAdd ( assembly , a => a . GetManifestResourceNames ( ) . ToImmutableHashSet ( ) ) ; var resources = resourceCache . Where ( k => k . Contains ( resourceDirectoryName ) ) . ToImmutableSortedSet ( new AnimationImageNameComparer ( ) ) . Select ( resource => new ImageStream ( scaleFactor : 1 , create : ( ) => assembly . GetManifestResourceStream ( resource ) ) ) . ToList ( ) ; return Implementation . Animate ( resources , duration , overlayColor ) ; }
Gathers all images under the given resource directory and plays them over the given duration.
Gathers all images under the given resource directory and plays them over the given duration .
None
resourceDirectoryName
string
None
assembly
Assembly
Assembly to find the embeded images resources
Assembly to find the embeded images resources
duration
TimeSpan
None
overlayColor
IObservable<Color>
Tint all images with the provided color.
Tint all images with the provided color .