[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Direct2D.RenderTarget

Class RenderTarget

Namespace
GrapeCity.Documents.DX.Direct2D
Assembly
GcDocs.DX.Windows.dll

ID2D1RenderTarget

[Guid("2cd90694-12e2-11dc-9fed-001143a055f9")]
public class RenderTarget : Resource, IDisposable, IUnknown
Inheritance
object
RenderTarget
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

RenderTarget(IntPtr)

Initializes a new instance of the RenderTarget class.

public RenderTarget(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

Fields

DefaultStrokeWidth

Default stroke width used for all methods that are not explicitly using it. Default is set to 1.0f.

public const float DefaultStrokeWidth = 1

Field Value

float

Properties

DotsPerInch

Get or sets the dots per inch (DPI) of the render target.

public Size2F DotsPerInch { get; set; }

Property Value

Size2F

StrokeWidth

Get or set the default stroke width used for all methods that are not explicitly using it. Default is set to 1.0f.

public float StrokeWidth { get; set; }

Property Value

float

Methods

BeginDraw()

void ID2D1RenderTarget::BeginDraw()

public void BeginDraw()

Clear(ColorF?)

void ID2D1RenderTarget::Clear([In, Optional] const D2D_COLOR_F* clearColor)

public void Clear(ColorF? clearColor)

Parameters

clearColor ColorF?

Create(Factory, Surface, ref RenderTargetProperties)

Creates a render target that draws to a DirectX Graphics Infrastructure (DXGI) surface.

public static RenderTarget Create(Factory factory, Surface dxgiSurface, ref RenderTargetProperties properties)

Parameters

factory Factory

an instance of Factory

dxgiSurface Surface

The dxgi surface to bind this render target to

properties RenderTargetProperties

The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering. For information about supported pixel formats, see {{Supported Pixel Formats and Alpha Modes}}.

Returns

RenderTarget

CreateBitmap(Size2L, IntPtr, int, BitmapProperties)

HRESULT ID2D1RenderTarget::CreateBitmap([In] D2D_SIZE_U size,[In, Optional] const void* srcData,[In] unsigned int pitch,[In] const D2D1_BITMAP_PROPERTIES* bitmapProperties,[Out, Fast] ID2D1Bitmap** bitmap)

public Bitmap CreateBitmap(Size2L size, IntPtr srcData, int pitch, BitmapProperties bitmapProperties)

Parameters

size Size2L
srcData System.IntPtr
pitch int
bitmapProperties BitmapProperties

Returns

Bitmap

CreateBitmapBrush(Bitmap, BitmapBrushProperties?, BrushProperties?)

HRESULT ID2D1RenderTarget::CreateBitmapBrush([In, Optional] ID2D1Bitmap* bitmap,[In, Optional] const D2D1_BITMAP_BRUSH_PROPERTIES* bitmapBrushProperties,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[Out, Fast] ID2D1BitmapBrush** bitmapBrush)

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

Parameters

bitmap Bitmap
bitmapBrushProperties BitmapBrushProperties?
brushProperties BrushProperties?

Returns

BitmapBrush

CreateBitmapFromWicBitmap(BitmapSource, BitmapProperties?)

HRESULT ID2D1RenderTarget::CreateBitmapFromWicBitmap([In] IWICBitmapSource* wicBitmapSource,[In, Optional] const D2D1_BITMAP_PROPERTIES* bitmapProperties,[Out] ID2D1Bitmap** bitmap)

public Bitmap CreateBitmapFromWicBitmap(BitmapSource wicBitmapSource, BitmapProperties? bitmapProperties)

Parameters

wicBitmapSource BitmapSource
bitmapProperties BitmapProperties?

Returns

Bitmap

CreateCompatibleRenderTarget(Size2F?, Size2L?, PixelFormat?, CompatibleRenderTargetOptions)

HRESULT ID2D1RenderTarget::CreateCompatibleRenderTarget([In, Optional] const D2D_SIZE_F* desiredSize,[In, Optional] const D2D_SIZE_U* desiredPixelSize,[In, Optional] const D2D1_PIXEL_FORMAT* desiredFormat,[In] D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,[Out, Fast] ID2D1BitmapRenderTarget** bitmapRenderTarget)

public BitmapRenderTarget CreateCompatibleRenderTarget(Size2F? desiredSize, Size2L? desiredPixelSize, PixelFormat? desiredFormat, CompatibleRenderTargetOptions options)

Parameters

desiredSize Size2F?
desiredPixelSize Size2L?
desiredFormat PixelFormat?
options CompatibleRenderTargetOptions

Returns

BitmapRenderTarget

CreateGradientStopCollection(GradientStop[], int, Gamma, ExtendMode)

HRESULT ID2D1RenderTarget::CreateGradientStopCollection([In, Buffer] const D2D1_GRADIENT_STOP* gradientStops,[In] unsigned int gradientStopsCount,[In] D2D1_GAMMA colorInterpolationGamma,[In] D2D1_EXTEND_MODE extendMode,[Out, Fast] ID2D1GradientStopCollection** gradientStopCollection)

public GradientStopCollection CreateGradientStopCollection(GradientStop[] gradientStops, int gradientStopsCount, Gamma colorInterpolationGamma, ExtendMode extendMode)

Parameters

gradientStops GradientStop[]
gradientStopsCount int
colorInterpolationGamma Gamma
extendMode ExtendMode

Returns

GradientStopCollection

CreateLayer(Size2F?)

HRESULT ID2D1RenderTarget::CreateLayer([In, Optional] const D2D_SIZE_F* size,[Out, Fast] ID2D1Layer** layer)

public Layer CreateLayer(Size2F? size)

Parameters

size Size2F?

Returns

Layer

CreateLinearGradientBrush(LinearGradientBrushProperties, BrushProperties?, GradientStopCollection)

HRESULT ID2D1RenderTarget::CreateLinearGradientBrush([In] const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES* linearGradientBrushProperties,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[In] ID2D1GradientStopCollection* gradientStopCollection,[Out, Fast] ID2D1LinearGradientBrush** linearGradientBrush)

public LinearGradientBrush CreateLinearGradientBrush(LinearGradientBrushProperties linearGradientBrushProperties, BrushProperties? brushProperties, GradientStopCollection gradientStopCollection)

Parameters

linearGradientBrushProperties LinearGradientBrushProperties
brushProperties BrushProperties?
gradientStopCollection GradientStopCollection

Returns

LinearGradientBrush

CreateMesh()

HRESULT ID2D1RenderTarget::CreateMesh([Out, Fast] ID2D1Mesh** mesh)

public Mesh CreateMesh()

Returns

Mesh

CreateRadialGradientBrush(ref RadialGradientBrushProperties, BrushProperties?, GradientStopCollection)

HRESULT ID2D1RenderTarget::CreateRadialGradientBrush([In] const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES* radialGradientBrushProperties,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[In] ID2D1GradientStopCollection* gradientStopCollection,[Out, Fast] ID2D1RadialGradientBrush** radialGradientBrush)

public RadialGradientBrush CreateRadialGradientBrush(ref RadialGradientBrushProperties radialGradientBrushProperties, BrushProperties? brushProperties, GradientStopCollection gradientStopCollection)

Parameters

radialGradientBrushProperties RadialGradientBrushProperties
brushProperties BrushProperties?
gradientStopCollection GradientStopCollection

Returns

RadialGradientBrush

CreateSharedBitmap(Guid, IntPtr, BitmapProperties?)

HRESULT ID2D1RenderTarget::CreateSharedBitmap([In] const GUID& riid,[In] void* data,[In, Optional] const D2D1_BITMAP_PROPERTIES* bitmapProperties,[Out, Fast] ID2D1Bitmap** bitmap)

public Bitmap CreateSharedBitmap(Guid riid, IntPtr data, BitmapProperties? bitmapProperties)

Parameters

riid System.Guid
data System.IntPtr
bitmapProperties BitmapProperties?

Returns

Bitmap

CreateSolidColorBrush(ColorF, BrushProperties?)

HRESULT ID2D1RenderTarget::CreateSolidColorBrush([In] const D2D_COLOR_F* color,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[Out, Fast] ID2D1SolidColorBrush** solidColorBrush)

public SolidColorBrush CreateSolidColorBrush(ColorF color, BrushProperties? brushProperties)

Parameters

color ColorF
brushProperties BrushProperties?

Returns

SolidColorBrush

DrawBitmap(Bitmap, RectF, float, BitmapInterpolationMode)

Draws the specified bitmap after scaling it to the size of the specified rectangle.

public void DrawBitmap(Bitmap bitmap, RectF destinationRectangle, float opacity = 1, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.Linear)

Parameters

bitmap Bitmap

The bitmap to render.

destinationRectangle RectF

The size and position, in device-independent pixels in the render target's coordinate space, of the area to which the bitmap is drawn; NULL to draw the selected portion of the bitmap at the origin of the render target. If the rectangle is specified but not well-ordered, nothing is drawn, but the render target does not enter an error state.

opacity float

A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents. The default value is 1.0f.

interpolationMode BitmapInterpolationMode

The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is Linear.

DrawBitmap(Bitmap, RectF?, float, BitmapInterpolationMode, RectF?)

void ID2D1RenderTarget::DrawBitmap([In] ID2D1Bitmap* bitmap,[In, Optional] const D2D_RECT_F* destinationRectangle,[In] float opacity,[In] D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,[In, Optional] const D2D_RECT_F* sourceRectangle)

public void DrawBitmap(Bitmap bitmap, RectF? destinationRectangle, float opacity, BitmapInterpolationMode interpolationMode, RectF? sourceRectangle)

Parameters

bitmap Bitmap
destinationRectangle RectF?
opacity float
interpolationMode BitmapInterpolationMode
sourceRectangle RectF?

DrawBitmap(Bitmap, float, BitmapInterpolationMode, RectF)

Draws the specified bitmap after scaling it to the size of the specified rectangle.

public void DrawBitmap(Bitmap bitmap, float opacity, BitmapInterpolationMode interpolationMode, RectF sourceRectangle)

Parameters

bitmap Bitmap

The bitmap to render.

opacity float

A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents. The default value is 1.0f.

interpolationMode BitmapInterpolationMode

The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is C1.Win.DX.Direct2D.BitmapInterpolationMode.Linear.

sourceRectangle RectF

The size and position, in device-independent pixels in the bitmap's coordinate space, of the area within the bitmap to be drawn; NULL to draw the entire bitmap.

DrawBitmap(Bitmap, float, BitmapInterpolationMode)

Draws the specified bitmap after scaling it to the size of the specified rectangle.

public void DrawBitmap(Bitmap bitmap, float opacity, BitmapInterpolationMode interpolationMode)

Parameters

bitmap Bitmap

The bitmap to render.

opacity float

A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents. The default value is 1.0f.

interpolationMode BitmapInterpolationMode

The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation. The default value is C1.Win.DX.Direct2D.BitmapInterpolationMode.Linear.

DrawEllipse(Ellipse, Brush, float, StrokeStyle)

void ID2D1RenderTarget::DrawEllipse([In] const D2D1_ELLIPSE* ellipse,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)

public void DrawEllipse(Ellipse ellipse, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)

Parameters

ellipse Ellipse
brush Brush
strokeWidth float
strokeStyle StrokeStyle

DrawGeometry(Geometry, Brush, float, StrokeStyle)

void ID2D1RenderTarget::DrawGeometry([In] ID2D1Geometry* geometry,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)

public void DrawGeometry(Geometry geometry, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)

Parameters

geometry Geometry
brush Brush
strokeWidth float
strokeStyle StrokeStyle

DrawGeometry(Geometry, Brush)

Draws the outline of the specified geometry.

public void DrawGeometry(Geometry geometry, Brush brush)

Parameters

geometry Geometry

The geometry to draw.

brush Brush

The brush used to paint the geometry's stroke.

DrawGlyphRun(Point2F, GlyphRun, Brush, MeasuringMode)

void ID2D1RenderTarget::DrawGlyphRun([In] D2D_POINT_2F baselineOrigin,[In] const DWRITE_GLYPH_RUN* glyphRun,[In] ID2D1Brush* foregroundBrush,[In] DWRITE_MEASURING_MODE measuringMode)

public void DrawGlyphRun(Point2F baselineOrigin, GlyphRun glyphRun, Brush foregroundBrush, MeasuringMode measuringMode)

Parameters

baselineOrigin Point2F
glyphRun GlyphRun
foregroundBrush Brush
measuringMode MeasuringMode

DrawGlyphRun(Point2F, IntPtr, Brush, MeasuringMode)

void ID2D1RenderTarget::DrawGlyphRun([In] D2D_POINT_2F baselineOrigin,[In] const DWRITE_GLYPH_RUN* glyphRun,[In] ID2D1Brush* foregroundBrush,[In] DWRITE_MEASURING_MODE measuringMode)

public void DrawGlyphRun(Point2F baselineOrigin, IntPtr glyphRun, Brush foregroundBrush, MeasuringMode measuringMode)

Parameters

baselineOrigin Point2F
glyphRun System.IntPtr
foregroundBrush Brush
measuringMode MeasuringMode

DrawLine(Point2F, Point2F, Brush, float, StrokeStyle)

void ID2D1RenderTarget::DrawLine([In] D2D_POINT_2F point0,[In] D2D_POINT_2F point1,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)

public void DrawLine(Point2F point0, Point2F point1, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)

Parameters

point0 Point2F
point1 Point2F
brush Brush
strokeWidth float
strokeStyle StrokeStyle

DrawLine(Point2F, Point2F, Brush)

Draws a line between the specified points.

public void DrawLine(Point2F point0, Point2F point1, Brush brush)

Parameters

point0 Point2F

The start point of the line, in device-independent pixels.

point1 Point2F

The end point of the line, in device-independent pixels.

brush Brush

The brush used to paint the line's stroke.

DrawRectangle(RectF, Brush, float, StrokeStyle)

void ID2D1RenderTarget::DrawRectangle([In] const D2D_RECT_F* rect,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)

public void DrawRectangle(RectF rect, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)

Parameters

rect RectF
brush Brush
strokeWidth float
strokeStyle StrokeStyle

DrawRoundedRectangle(RoundedRectangle, Brush, float, StrokeStyle)

void ID2D1RenderTarget::DrawRoundedRectangle([In] const D2D1_ROUNDED_RECT* roundedRect,[In] ID2D1Brush* brush,[In] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle)

public void DrawRoundedRectangle(RoundedRectangle roundedRect, Brush brush, float strokeWidth, StrokeStyle strokeStyle = null)

Parameters

roundedRect RoundedRectangle
brush Brush
strokeWidth float
strokeStyle StrokeStyle

DrawText(string, TextFormat, RectF, Brush, DrawTextOptions, MeasuringMode)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options, MeasuringMode measuringMode)

Parameters

text string

A reference to an array of Unicode characters to draw.

textFormat TextFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

layoutRect RectF

The size and position of the area in which the text is drawn.

defaultForegroundBrush Brush

The brush used to paint the text.

options DrawTextOptions

A value that indicates whether the text should be snapped to pixel boundaries and whether the text should be clipped to the layout rectangle. The default value is C1.Win.DX.Direct2D.DrawTextOptions.None, which indicates that text should be snapped to pixel boundaries and it should not be clipped to the layout rectangle.

measuringMode MeasuringMode

A value that indicates how glyph metrics are used to measure text when it is formatted. The default value is DWRITE_MEASURING_MODE_NATURAL.

DrawText(string, TextFormat, RectF, Brush, DrawTextOptions)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options)

Parameters

text string

A reference to an array of Unicode characters to draw.

textFormat TextFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

layoutRect RectF

The size and position of the area in which the text is drawn.

defaultForegroundBrush Brush

The brush used to paint the text.

options DrawTextOptions

A value that indicates whether the text should be snapped to pixel boundaries and whether the text should be clipped to the layout rectangle. The default value is C1.Win.DX.Direct2D.DrawTextOptions.None, which indicates that text should be snapped to pixel boundaries and it should not be clipped to the layout rectangle.

DrawText(string, TextFormat, RectF, Brush)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush)

Parameters

text string

A reference to an array of Unicode characters to draw.

textFormat TextFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

layoutRect RectF

The size and position of the area in which the text is drawn.

defaultForegroundBrush Brush

The brush used to paint the text.

DrawText(string, int, TextFormat, RectF, Brush, DrawTextOptions, MeasuringMode)

void ID2D1RenderTarget::DrawText([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] const D2D_RECT_F* layoutRect,[In] ID2D1Brush* defaultForegroundBrush,[In] D2D1_DRAW_TEXT_OPTIONS options,[In] DWRITE_MEASURING_MODE measuringMode)

public void DrawText(string text, int stringLength, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options = DrawTextOptions.None, MeasuringMode measuringMode = MeasuringMode.Natural)

Parameters

text string
stringLength int
textFormat TextFormat
layoutRect RectF
defaultForegroundBrush Brush
options DrawTextOptions
measuringMode MeasuringMode

DrawTextLayout(Point2F, TextLayout, Brush, DrawTextOptions)

void ID2D1RenderTarget::DrawTextLayout([In] D2D_POINT_2F origin,[In] IDWriteTextLayout* textLayout,[In] ID2D1Brush* defaultForegroundBrush,[In] D2D1_DRAW_TEXT_OPTIONS options)

public void DrawTextLayout(Point2F origin, TextLayout textLayout, Brush defaultForegroundBrush, DrawTextOptions options)

Parameters

origin Point2F
textLayout TextLayout
defaultForegroundBrush Brush
options DrawTextOptions

DrawTextLayout(Point2F, TextLayout, Brush)

Draws the formatted text described by the specified C1.Win.DX.DirectWrite.TextLayout object.

public void DrawTextLayout(Point2F origin, TextLayout textLayout, Brush defaultForegroundBrush)

Parameters

origin Point2F

The point, described in device-independent pixels, at which the upper-left corner of the text described by textLayout is drawn.

textLayout TextLayout

The formatted text to draw. Any drawing effects that do not inherit from C1.Win.DX.Direct2D.Resource are ignored. If there are drawing effects that inherit from ID2D1Resource that are not brushes, this method fails and the render target is put in an error state.

defaultForegroundBrush Brush

The brush used to paint any text in textLayout that does not already have a brush associated with it as a drawing effect (specified by the C1.Win.DX.DirectWrite.TextLayout.SetDrawingEffect(C1.Win.DX.ComObject,C1.Win.DX.DirectWrite.TextRange) method).

EndDraw(bool)

HRESULT ID2D1RenderTarget::EndDraw([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public bool EndDraw(bool checkRecreateTaget = false)

Parameters

checkRecreateTaget bool

Returns

bool

EndDraw(out long, out long)

HRESULT ID2D1RenderTarget::EndDraw([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public HResult EndDraw(out long tag1, out long tag2)

Parameters

tag1 long
tag2 long

Returns

HResult

EndDrawHR()

HRESULT ID2D1RenderTarget::EndDraw([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public HResult EndDrawHR()

Returns

HResult

FillEllipse(Ellipse, Brush)

void ID2D1RenderTarget::FillEllipse([In] const D2D1_ELLIPSE* ellipse,[In] ID2D1Brush* brush)

public void FillEllipse(Ellipse ellipse, Brush brush)

Parameters

ellipse Ellipse
brush Brush

FillGeometry(Geometry, Brush, Brush)

void ID2D1RenderTarget::FillGeometry([In] ID2D1Geometry* geometry,[In] ID2D1Brush* brush,[In, Optional] ID2D1Brush* opacityBrush)

public void FillGeometry(Geometry geometry, Brush brush, Brush opacityBrush)

Parameters

geometry Geometry
brush Brush
opacityBrush Brush

FillGeometry(Geometry, Brush)

Paints the interior of the specified geometry.

public void FillGeometry(Geometry geometry, Brush brush)

Parameters

geometry Geometry

The geometry to paint.

brush Brush

The brush used to paint the geometry's interior.

FillMesh(Mesh, Brush)

void ID2D1RenderTarget::FillMesh([In] ID2D1Mesh* mesh,[In] ID2D1Brush* brush)

public void FillMesh(Mesh mesh, Brush brush)

Parameters

mesh Mesh
brush Brush

FillOpacityMask(Bitmap, Brush, OpacityMaskContent, RectF?, RectF?)

void ID2D1RenderTarget::FillOpacityMask([In] ID2D1Bitmap* opacityMask,[In] ID2D1Brush* brush,[In] D2D1_OPACITY_MASK_CONTENT content,[In, Optional] const D2D_RECT_F* destinationRectangle,[In, Optional] const D2D_RECT_F* sourceRectangle)

public void FillOpacityMask(Bitmap opacityMask, Brush brush, OpacityMaskContent content, RectF? destinationRectangle, RectF? sourceRectangle)

Parameters

opacityMask Bitmap
brush Brush
content OpacityMaskContent
destinationRectangle RectF?
sourceRectangle RectF?

FillOpacityMask(Bitmap, Brush, OpacityMaskContent)

Applies the opacity mask described by the specified bitmap to a brush and uses that brush to paint a region of the render target.

public void FillOpacityMask(Bitmap opacityMask, Brush brush, OpacityMaskContent content)

Parameters

opacityMask Bitmap

The opacity mask to apply to the brush. The alpha value of each pixel in the region specified by sourceRectangle is multiplied with the alpha value of the brush after the brush has been mapped to the area defined by destinationRectangle.

brush Brush

The brush used to paint the region of the render target specified by destinationRectangle.

content OpacityMaskContent

The type of content the opacity mask contains. The value is used to determine the color space in which the opacity mask is blended.

FillRectangle(RectF, Brush)

void ID2D1RenderTarget::FillRectangle([In] const D2D_RECT_F* rect,[In] ID2D1Brush* brush)

public void FillRectangle(RectF rect, Brush brush)

Parameters

rect RectF
brush Brush

FillRoundedRectangle(RoundedRectangle, Brush)

void ID2D1RenderTarget::FillRoundedRectangle([In] const D2D1_ROUNDED_RECT* roundedRect,[In] ID2D1Brush* brush)

public void FillRoundedRectangle(RoundedRectangle roundedRect, Brush brush)

Parameters

roundedRect RoundedRectangle
brush Brush

Flush()

HRESULT ID2D1RenderTarget::Flush([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public void Flush()

Flush(out long, out long)

HRESULT ID2D1RenderTarget::Flush([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public void Flush(out long tag1, out long tag2)

Parameters

tag1 long
tag2 long

GetAntialiasMode()

D2D1_ANTIALIAS_MODE ID2D1RenderTarget::GetAntialiasMode()

public AntialiasMode GetAntialiasMode()

Returns

AntialiasMode

GetDpi(out float, out float)

void ID2D1RenderTarget::GetDpi([Out] float* dpiX,[Out] float* dpiY)

public void GetDpi(out float dpiX, out float dpiY)

Parameters

dpiX float
dpiY float

GetMaximumBitmapSize()

unsigned int ID2D1RenderTarget::GetMaximumBitmapSize()

public int GetMaximumBitmapSize()

Returns

int

GetPixelFormat()

D2D1_PIXEL_FORMAT ID2D1RenderTarget::GetPixelFormat()

public PixelFormat GetPixelFormat()

Returns

PixelFormat

GetPixelSize()

D2D_SIZE_U ID2D1RenderTarget::GetPixelSize()

public Size2L GetPixelSize()

Returns

Size2L

GetSize()

D2D_SIZE_F ID2D1RenderTarget::GetSize()

public Size2F GetSize()

Returns

Size2F

GetTags(out long, out long)

void ID2D1RenderTarget::GetTags([Out, Optional] unsigned longlong* tag1,[Out, Optional] unsigned longlong* tag2)

public void GetTags(out long tag1, out long tag2)

Parameters

tag1 long
tag2 long

GetTextAntialiasMode()

D2D1_TEXT_ANTIALIAS_MODE ID2D1RenderTarget::GetTextAntialiasMode()

public TextAntialiasMode GetTextAntialiasMode()

Returns

TextAntialiasMode

GetTextRenderingParams()

void ID2D1RenderTarget::GetTextRenderingParams([Out, Optional] IDWriteRenderingParams** textRenderingParams)

public RenderingParams GetTextRenderingParams()

Returns

RenderingParams

GetTransform()

void ID2D1RenderTarget::GetTransform([Out] D2D_MATRIX_3X2_F* transform)

public Matrix3x2 GetTransform()

Returns

Matrix3x2

IsSupported(ref RenderTargetProperties)

BOOL ID2D1RenderTarget::IsSupported([In] const D2D1_RENDER_TARGET_PROPERTIES* renderTargetProperties)

public bool IsSupported(ref RenderTargetProperties renderTargetProperties)

Parameters

renderTargetProperties RenderTargetProperties

Returns

bool

PopAxisAlignedClip()

void ID2D1RenderTarget::PopAxisAlignedClip()

public void PopAxisAlignedClip()

PopLayer()

void ID2D1RenderTarget::PopLayer()

public void PopLayer()

PushAxisAlignedClip(RectF, AntialiasMode)

void ID2D1RenderTarget::PushAxisAlignedClip([In] const D2D_RECT_F* clipRect,[In] D2D1_ANTIALIAS_MODE antialiasMode)

public void PushAxisAlignedClip(RectF clipRect, AntialiasMode antialiasMode)

Parameters

clipRect RectF
antialiasMode AntialiasMode

PushLayer(ref LayerParameters, Layer)

void ID2D1RenderTarget::PushLayer([In] const D2D1_LAYER_PARAMETERS* layerParameters,[In, Optional] ID2D1Layer* layer)

public void PushLayer(ref LayerParameters layerParameters, Layer layer = null)

Parameters

layerParameters LayerParameters
layer Layer

QueryGdiInterop()

Returns an instance of GdiInteropRenderTarget for the current RenderTarget.

public GdiInteropRenderTarget QueryGdiInterop()

Returns

GdiInteropRenderTarget

RestoreDrawingState(DrawingStateBlock)

void ID2D1RenderTarget::RestoreDrawingState([In] ID2D1DrawingStateBlock* drawingStateBlock)

public void RestoreDrawingState(DrawingStateBlock drawingStateBlock)

Parameters

drawingStateBlock DrawingStateBlock

SaveDrawingState(DrawingStateBlock)

void ID2D1RenderTarget::SaveDrawingState([InOut] ID2D1DrawingStateBlock* drawingStateBlock)

public void SaveDrawingState(DrawingStateBlock drawingStateBlock)

Parameters

drawingStateBlock DrawingStateBlock

SetAntialiasMode(AntialiasMode)

void ID2D1RenderTarget::SetAntialiasMode([In] D2D1_ANTIALIAS_MODE antialiasMode)

public void SetAntialiasMode(AntialiasMode antialiasMode)

Parameters

antialiasMode AntialiasMode

SetDpi(float, float)

void ID2D1RenderTarget::SetDpi([In] float dpiX,[In] float dpiY)

public void SetDpi(float dpiX, float dpiY)

Parameters

dpiX float
dpiY float

SetTags(long, long)

void ID2D1RenderTarget::SetTags([In] unsigned longlong tag1,[In] unsigned longlong tag2)

public void SetTags(long tag1, long tag2)

Parameters

tag1 long
tag2 long

SetTextAntialiasMode(TextAntialiasMode)

void ID2D1RenderTarget::SetTextAntialiasMode([In] D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode)

public void SetTextAntialiasMode(TextAntialiasMode textAntialiasMode)

Parameters

textAntialiasMode TextAntialiasMode

SetTextRenderingParams(RenderingParams)

void ID2D1RenderTarget::SetTextRenderingParams([In, Optional] IDWriteRenderingParams* textRenderingParams)

public void SetTextRenderingParams(RenderingParams textRenderingParams)

Parameters

textRenderingParams RenderingParams

SetTransform(Matrix3x2)

void ID2D1RenderTarget::SetTransform([In] const D2D_MATRIX_3X2_F* transform)

public void SetTransform(Matrix3x2 transform)

Parameters

transform Matrix3x2

Operators

explicit operator RenderTarget(IntPtr)

Performs an explicit conversion from System.IntPtr to RenderTarget.

public static explicit operator RenderTarget(IntPtr nativePointer)

Parameters

nativePointer System.IntPtr

Returns

RenderTarget