Table of Contents

Class BitmapBrush

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll
[Guid("2cd906aa-12e2-11dc-9fed-001143a055f9")]
public class BitmapBrush : Brush
Inheritance
BitmapBrush
Derived
Inherited Members

Constructors

BitmapBrush(RenderTarget, Bitmap)

Creates an BitmapBrush from the specified bitmap.

public BitmapBrush(RenderTarget renderTarget, Bitmap bitmap)

Parameters

renderTarget RenderTarget

an instance of RenderTarget

bitmap Bitmap

The bitmap contents of the new brush.

BitmapBrush(RenderTarget, Bitmap, BitmapBrushProperties)

Creates an BitmapBrush from the specified bitmap.

public BitmapBrush(RenderTarget renderTarget, Bitmap bitmap, BitmapBrushProperties bitmapBrushProperties)

Parameters

renderTarget RenderTarget

an instance of RenderTarget

bitmap Bitmap

The bitmap contents of the new brush.

bitmapBrushProperties BitmapBrushProperties

The extend modes and interpolation mode of the new brush, or NULL. If this parameter is NULL, the brush defaults to the Clamp horizontal and vertical extend modes and the Linear interpolation mode.

BitmapBrush(RenderTarget, Bitmap, BrushProperties)

Creates an BitmapBrush from the specified bitmap.

public BitmapBrush(RenderTarget renderTarget, Bitmap bitmap, BrushProperties brushProperties)

Parameters

renderTarget RenderTarget

an instance of RenderTarget

bitmap Bitmap

The bitmap contents of the new brush.

brushProperties BrushProperties

The opacity and transform of the new brush, or NULL. If this parameter is NULL, the brush defaults to an opacity of 1.0f and its transform is the identity matrix.

BitmapBrush(RenderTarget, Bitmap, BitmapBrushProperties?, BrushProperties?)

Creates an BitmapBrush from the specified bitmap.

public BitmapBrush(RenderTarget renderTarget, Bitmap bitmap, BitmapBrushProperties? bitmapBrushProperties, BrushProperties? brushProperties)

Parameters

renderTarget RenderTarget

an instance of RenderTarget

bitmap Bitmap

The bitmap contents of the new brush.

bitmapBrushProperties BitmapBrushProperties?

The extend modes and interpolation mode of the new brush, or NULL. If this parameter is NULL, the brush defaults to the Clamp horizontal and vertical extend modes and the Linear interpolation mode.

brushProperties BrushProperties?

The opacity and transform of the new brush, or NULL. If this parameter is NULL, the brush defaults to an opacity of 1.0f and its transform is the identity matrix.

BitmapBrush(nint)

public BitmapBrush(nint nativePtr)

Parameters

nativePtr nint

Properties

Bitmap

Gets or sets the bitmap source that this brush uses to paint.

public Bitmap Bitmap { get; set; }

Property Value

Bitmap

ExtendModeX

Gets or sets the method by which the brush horizontally tiles those areas that extend past its bitmap.

public ExtendMode ExtendModeX { get; set; }

Property Value

ExtendMode

Remarks

Like all brushes, BitmapBrush defines an infinite plane of content. Because bitmaps are finite, it relies on an extend mode to determine how the plane is filled horizontally and vertically.

ExtendModeY

Gets or sets the method by which the brush vertically tiles those areas that extend past its bitmap.

public ExtendMode ExtendModeY { get; set; }

Property Value

ExtendMode

Remarks

Like all brushes, BitmapBrush defines an infinite plane of content. Because bitmaps are finite, it relies on an extend mode to determine how the plane is filled horizontally and vertically.

InterpolationMode

Gets or sets the interpolation method used when the brush bitmap is scaled or rotated.

public BitmapInterpolationMode InterpolationMode { get; set; }

Property Value

BitmapInterpolationMode

Remarks

This method gets the interpolation mode of a bitmap, which is specified by the BitmapInterpolationMode enumeration type. D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR represents nearest neighbor filtering. It looks up the bitmap pixel nearest to the current rendering pixel and chooses its exact color. D2D1_BITMAP_INTERPOLATION_MODE_LINEAR represents linear filtering, and interpolates a color from the four nearest bitmap pixels.

The interpolation mode of a bitmap also affects subpixel translations. In a subpixel translation, linear interpolation positions the bitmap more precisely to the application request, but blurs the bitmap in the process.

Operators

explicit operator BitmapBrush(nint)

public static explicit operator BitmapBrush(nint nativePtr)

Parameters

nativePtr nint

Returns

BitmapBrush