VeeFriends.LiveCommerce.Thumbnails
5.0.6
See the version list below for details.
dotnet add package VeeFriends.LiveCommerce.Thumbnails --version 5.0.6
NuGet\Install-Package VeeFriends.LiveCommerce.Thumbnails -Version 5.0.6
<PackageReference Include="VeeFriends.LiveCommerce.Thumbnails" Version="5.0.6" />
paket add VeeFriends.LiveCommerce.Thumbnails --version 5.0.6
#r "nuget: VeeFriends.LiveCommerce.Thumbnails, 5.0.6"
// Install VeeFriends.LiveCommerce.Thumbnails as a Cake Addin #addin nuget:?package=VeeFriends.LiveCommerce.Thumbnails&version=5.0.6 // Install VeeFriends.LiveCommerce.Thumbnails as a Cake Tool #tool nuget:?package=VeeFriends.LiveCommerce.Thumbnails&version=5.0.6
VeeFriends.LiveCommerce.Thumbnails
A .NET library for generating dynamic thumbnails for VeeFriends LiveCommerce streams, with support for customizable layouts, backgrounds, effects, and host placement.
Features
- Dynamic Host Placement: Automatically position up to 5 host images with appropriate layout and overlap
- Layered Composition: Build thumbnails with multiple visual layers (background, effects, logo, hosts, footer)
- Custom Effects: Apply Photoshop-like blend modes (Screen, Multiply, Overlay, etc.)
- Flexible Asset Management: Easily access and manage backgrounds, logos, host images, and effects
- Configurable Output: Save thumbnails with customizable file naming conventions
Installation
dotnet add package VeeFriends.LiveCommerce.Thumbnails
Quick Start
- Register the thumbnail generator services in your dependency injection container:
using Microsoft.Extensions.DependencyInjection;
using VeeFriends.LiveCommerce.Thumbnails;
// Add to your service collection
services.AddThumbnailGenerator();
- Generate thumbnails with the
ThumbnailGenerator
:
public class ThumbnailService
{
private readonly ThumbnailGenerator _thumbnailGenerator;
public ThumbnailService(ThumbnailGenerator thumbnailGenerator)
{
_thumbnailGenerator = thumbnailGenerator;
}
public Stream CreateStreamThumbnail(List<string> hostNames, int backgroundIndex)
{
var options = new ThumbnailGenerator.ThumbnailOptions(
Hosts: hostNames,
BackgroundIndex: backgroundIndex,
OutputDirectory: "thumbnails/streams",
EffectIndex: 2,
EffectBlendingMode: PixelColorBlendingMode.Screen,
EffectPlacement: AssetManager.EffectPlacement.Top
);
return _thumbnailGenerator.GenerateThumbnail(options);
}
}
Core Components
ThumbnailGenerator
The main entry point for generating thumbnails, combining all the layers into a final image.
AssetManager
Manages and provides access to all visual assets:
- Backgrounds
- Effects
- Host images
- Logo
- Footer
HostPlacer
Handles the placement of host images based on the number of hosts (1-5), ensuring proper layout and overlap.
LayerDrawer
Manages the drawing and composition of various layers:
- Background
- Effects with blend modes
- Logo
- Host overlay
- Footer
Configuration Options
The ThumbnailOptions
record provides configuration for thumbnail generation:
public sealed record ThumbnailOptions(
List<string> Hosts, // Host names to include
int BackgroundIndex, // Background image index
string OutputDirectory, // Where to save the output
int EffectIndex = 1, // Effect index to apply
PixelColorBlendingMode EffectBlendingMode = PixelColorBlendingMode.Screen, // Blend mode for effect
AssetManager.EffectPlacement EffectPlacement = AssetManager.EffectPlacement.Top // Effect placement
)
Example Output
Thumbnails are saved with automatically generated filenames based on hosts, background, and effects:
hosts-gary-vee-snoop-dogg_bg-3_fx-2-screen-top.png
Requirements
- .NET 6.0 or higher
- SixLabors.ImageSharp
License
Copyright © VeeFriends
Product | Versions 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. |
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.3)
- SixLabors.ImageSharp.Drawing (>= 2.1.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.