Quantumm.Image 1.1.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Quantumm.Image --version 1.1.5
                    
NuGet\Install-Package Quantumm.Image -Version 1.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Quantumm.Image" Version="1.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Quantumm.Image" Version="1.1.5" />
                    
Directory.Packages.props
<PackageReference Include="Quantumm.Image" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Quantumm.Image --version 1.1.5
                    
#r "nuget: Quantumm.Image, 1.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Quantumm.Image@1.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Quantumm.Image&version=1.1.5
                    
Install as a Cake Addin
#tool nuget:?package=Quantumm.Image&version=1.1.5
                    
Install as a Cake Tool

Quantumm.Image

NuGet

Quantumm.Image is an asynchronous, thread-safe, LRU-aware image caching library designed for Avalonia applications. It provides fast and memory-efficient image loading with support for dependency injection and duplicate download prevention.


Features

  • Asynchronous image loading from disk
  • Memory-limited LRU (Least Recently Used) caching
  • Thread-safe access to cached images
  • Automatic eviction of least recently used images
  • Prevents multiple concurrent loads of the same image
  • Easy dependency injection integration with Microsoft.Extensions.DependencyInjection
  • Detailed XML documentation for all public interfaces
  • Supports Avalonia 11 and .NET 9

Installation

Install via NuGet:

dotnet add package Quantumm.Image --version 1.1

Usage

  1. Register the service in your DI container
    using Microsoft.Extensions.DependencyInjection;
    using Quantumm.Image.Services.DependencyInjection;
    
    var services = new ServiceCollection();
    
    // Register ImageCacheService with optional capacity (default 100)
    services.AddImageCache(capacity: 200);
    
    var serviceProvider = services.BuildServiceProvider();
    
  2. Resolve and use the service
     using Quantumm.Image.Services.ImageCache;
     using Avalonia.Media.Imaging;
    
     var imageCache = serviceProvider.GetRequiredService<IImageCacheService>();
    
     // Load an image asynchronously
     Bitmap image = await imageCache.LoadImage("path/to/image.png");
    
     // Update an image in cache if the file has changed
     Bitmap updatedImage = await imageCache.UpdateImage("path/to/image.png");
    

API

IImageCacheService

  • Task<Bitmap> LoadImage(string filePath) Loads an image from cache or disk asynchronously. Adds it to the cache if it wasn't already present.

  • Task<Bitmap> UpdateImage(string path) Updates an existing image in the cache by loading a new version from disk. Adds it if it does not exist.

Logging

ImageCacheService supports logging via Microsoft.Extensions.Logging. Useful events include:

  • Image loading
  • Image eviction
  • Errors during image load or disposal
services.AddLogging(builder => builder.AddConsole());

Supported Platforms

  • Avalonia 11
  • .NET 9.0

License

MIT License. See LICENSE for details.

Contributors

See all contributors

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.6 234 9/21/2025
1.1.5 243 9/20/2025
1.1.4 245 9/20/2025
1.1.0 253 9/20/2025