Table of Contents

Class DrawImageProcessor

Namespace
SixLabors.ImageSharp.Processing.Processors.Drawing
Assembly
SixLabors.ImageSharp.dll

Combines two images together by blending the pixels.

public class DrawImageProcessor : IImageProcessor
Inheritance
DrawImageProcessor
Implements
Inherited Members

Constructors

DrawImageProcessor(Image, Point, PixelColorBlendingMode, PixelAlphaCompositionMode, float, int)

Initializes a new instance of the DrawImageProcessor class.

public DrawImageProcessor(Image foreground, Point backgroundLocation, PixelColorBlendingMode colorBlendingMode, PixelAlphaCompositionMode alphaCompositionMode, float opacity, int foregroundRepeatCount)

Parameters

foreground Image

The image to blend.

backgroundLocation Point

The location to draw the foreground image on the background.

colorBlendingMode PixelColorBlendingMode

The blending mode to use when drawing the image.

alphaCompositionMode PixelAlphaCompositionMode

The Alpha blending mode to use when drawing the image.

opacity float

The opacity of the image to blend.

foregroundRepeatCount int

The number of times the foreground frames are allowed to loop. 0 means infinitely.

DrawImageProcessor(Image, Point, Rectangle, PixelColorBlendingMode, PixelAlphaCompositionMode, float, int)

Initializes a new instance of the DrawImageProcessor class.

public DrawImageProcessor(Image foreground, Point backgroundLocation, Rectangle foregroundRectangle, PixelColorBlendingMode colorBlendingMode, PixelAlphaCompositionMode alphaCompositionMode, float opacity, int foregroundRepeatCount)

Parameters

foreground Image

The image to blend.

backgroundLocation Point

The location to draw the foreground image on the background.

foregroundRectangle Rectangle

The rectangular portion of the foreground image to draw.

colorBlendingMode PixelColorBlendingMode

The blending mode to use when drawing the image.

alphaCompositionMode PixelAlphaCompositionMode

The Alpha blending mode to use when drawing the image.

opacity float

The opacity of the image to blend.

foregroundRepeatCount int

The number of times the foreground frames are allowed to loop. 0 means infinitely.

Properties

AlphaCompositionMode

Gets the Alpha blending mode to use when drawing the image.

public PixelAlphaCompositionMode AlphaCompositionMode { get; }

Property Value

PixelAlphaCompositionMode

BackgroundLocation

Gets the location to draw the foreground image on the background.

public Point BackgroundLocation { get; }

Property Value

Point

ColorBlendingMode

Gets the blending mode to use when drawing the image.

public PixelColorBlendingMode ColorBlendingMode { get; }

Property Value

PixelColorBlendingMode

ForeGround

Gets the image to blend.

public Image ForeGround { get; }

Property Value

Image

ForegroundRectangle

Gets the rectangular portion of the foreground image to draw.

public Rectangle ForegroundRectangle { get; }

Property Value

Rectangle

ForegroundRepeatCount

Gets the number of times the foreground frames are allowed to loop. 0 means infinitely.

public int ForegroundRepeatCount { get; }

Property Value

int

Opacity

Gets the opacity of the image to blend.

public float Opacity { get; }

Property Value

float

Methods

CreatePixelSpecificProcessor<TPixelBg>(Configuration, Image<TPixelBg>, Rectangle)

Creates a pixel specific IImageProcessor<TPixel> that is capable of executing the processing algorithm on an Image<TPixel>.

public IImageProcessor<TPixelBg> CreatePixelSpecificProcessor<TPixelBg>(Configuration configuration, Image<TPixelBg> source, Rectangle sourceRectangle) where TPixelBg : unmanaged, IPixel<TPixelBg>

Parameters

configuration Configuration

The configuration which allows altering default behaviour or extending the library.

source Image<TPixelBg>

The source image. Cannot be null.

sourceRectangle Rectangle

The Rectangle structure that specifies the portion of the image object to draw.

Returns

IImageProcessor<TPixelBg>

The IImageProcessor<TPixel>

Type Parameters

TPixelBg