[]
ID2D1DeviceContext
[Guid("e8f7fe7a-191c-466d-ad95-975678bda998")]
public class DeviceContext : RenderTarget, IDisposable, IUnknown
Initializes a new instance of the DeviceContext class.
public DeviceContext(IntPtr nativePtr)
nativePtr System.IntPtrThe native pointer.
Initializes a new instance of the DeviceContext class using an existing Device.
public static DeviceContext Create(Device device, DeviceContextOptions options)
device DeviceThe device.
options DeviceContextOptionsThe options to be applied to the created device context.
The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
Initializes a new instance of the Device class.
public static DeviceContext Create(Surface surface, CreationProperties creationProperties)
surface SurfaceThe surface.
creationProperties CreationPropertiesThe creation properties.
Initializes a new instance of the DeviceContext class.
public static DeviceContext Create(Surface surface)
surface SurfaceThe surface.
HRESULT ID2D1DeviceContext::CreateBitmap([In] D2D_SIZE_U size,[In, Optional] const void* sourceData,[In] unsigned int pitch,[In] const D2D1_BITMAP_PROPERTIES1* bitmapProperties,[Out, Fast] ID2D1Bitmap1** bitmap)
public Bitmap1 CreateBitmap1(Size2L size, IntPtr sourceData, int pitch, BitmapProperties1 bitmapProperties)
size Size2LsourceData System.IntPtrpitch intbitmapProperties BitmapProperties1HRESULT ID2D1DeviceContext::CreateBitmapFromDxgiSurface([In] IDXGISurface* surface,[In, Optional] const D2D1_BITMAP_PROPERTIES1* bitmapProperties,[Out, Fast] ID2D1Bitmap1** bitmap)
public Bitmap1 CreateBitmap1FromDxgiSurface(Surface surface, BitmapProperties1 bitmapProperties)
surface SurfacebitmapProperties BitmapProperties1HRESULT ID2D1DeviceContext::CreateBitmapFromWicBitmap([In] IWICBitmapSource* wicBitmapSource,[In, Optional] const D2D1_BITMAP_PROPERTIES1* bitmapProperties,[Out] ID2D1Bitmap1** bitmap)
public Bitmap1 CreateBitmap1FromWicBitmap(BitmapSource wicBitmapSource, BitmapProperties1 bitmapProperties)
wicBitmapSource BitmapSourcebitmapProperties BitmapProperties1HRESULT ID2D1DeviceContext::CreateBitmapBrush([In, Optional] ID2D1Bitmap* bitmap,[In, Optional] const D2D1_BITMAP_BRUSH_PROPERTIES1* bitmapBrushProperties,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[Out, Fast] ID2D1BitmapBrush1** bitmapBrush)
public BitmapBrush1 CreateBitmapBrush1(Bitmap bitmap, BitmapBrushProperties1? bitmapBrushProperties, BrushProperties? brushProperties)
bitmap BitmapbitmapBrushProperties BitmapBrushProperties1?brushProperties BrushProperties?HRESULT ID2D1DeviceContext::CreateColorContext([In] D2D1_COLOR_SPACE space,[In, Buffer, Optional] const unsigned char* profile,[In] unsigned int profileSize,[Out, Fast] ID2D1ColorContext** colorContext)
public ColorContext CreateColorContext(ColorSpace space, byte[] rofileRef, int profileSize)
space ColorSpacerofileRef byte[]profileSize intHRESULT ID2D1DeviceContext::CreateColorContextFromFilename([In] const wchar_t* filename,[Out, Fast] ID2D1ColorContext** colorContext)
public ColorContext CreateColorContextFromFilename(string filename)
filename stringHRESULT ID2D1DeviceContext::CreateColorContextFromWicColorContext([In] IWICColorContext* wicColorContext,[Out, Fast] ID2D1ColorContext** colorContext)
public ColorContext CreateColorContextFromWicColorContext(ColorContext wicColorContext)
wicColorContext ColorContextHRESULT ID2D1DeviceContext::CreateCommandList([Out, Fast] ID2D1CommandList** commandList)
public CommandList CreateCommandList()
HRESULT ID2D1DeviceContext::CreateEffect([In] const GUID& effectId,[Out, Fast] ID2D1Effect** effect)
public void CreateEffect(Guid effectId, Effect effect)
effectId System.Guideffect EffectHRESULT ID2D1DeviceContext::CreateEffect([In] const GUID& effectId,[Out, Fast] ID2D1Effect** effect)
public Effect CreateEffect(Guid effectId)
effectId System.GuidHRESULT ID2D1DeviceContext::CreateGradientStopCollection([In, Buffer] const D2D1_GRADIENT_STOP* straightAlphaGradientStops,[In] unsigned int straightAlphaGradientStopsCount,[In] D2D1_COLOR_SPACE preInterpolationSpace,[In] D2D1_COLOR_SPACE postInterpolationSpace,[In] D2D1_BUFFER_PRECISION bufferPrecision,[In] D2D1_EXTEND_MODE extendMode,[In] D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode,[Out, Fast] ID2D1GradientStopCollection1** gradientStopCollection1)
public GradientStopCollection1 CreateGradientStopCollection1(GradientStop[] straightAlphaGradientStops, int straightAlphaGradientStopsCount, ColorSpace preInterpolationSpace, ColorSpace postInterpolationSpace, BufferPrecision bufferPrecision, ExtendMode extendMode, ColorInterpolationMode colorInterpolationMode)
straightAlphaGradientStops GradientStop[]straightAlphaGradientStopsCount intpreInterpolationSpace ColorSpacepostInterpolationSpace ColorSpacebufferPrecision BufferPrecisionextendMode ExtendModecolorInterpolationMode ColorInterpolationModeHRESULT ID2D1DeviceContext::CreateImageBrush([In, Optional] ID2D1Image* image,[In] const D2D1_IMAGE_BRUSH_PROPERTIES* imageBrushProperties,[In, Optional] const D2D1_BRUSH_PROPERTIES* brushProperties,[Out, Fast] ID2D1ImageBrush** imageBrush)
public ImageBrush CreateImageBrush(Image image, ref ImageBrushProperties imageBrushProperties, BrushProperties? brushProperties)
image ImageimageBrushProperties ImageBrushPropertiesbrushProperties BrushProperties?void ID2D1DeviceContext::DrawBitmap([In] ID2D1Bitmap* bitmap,[In, Optional] const D2D_RECT_F* destinationRectangle,[In] float opacity,[In] D2D1_INTERPOLATION_MODE interpolationMode,[In, Optional] const D2D_RECT_F* sourceRectangle,[In, Optional] const D2D_MATRIX_4X4_F* perspectiveTransform)
public void DrawBitmap(Bitmap bitmap, RectF? destinationRectangle, float opacity, InterpolationMode interpolationMode, RectF? sourceRectangle, Matrix4x4? perspectiveTransformRef)
bitmap BitmapdestinationRectangle RectF?opacity floatinterpolationMode InterpolationModesourceRectangle RectF?perspectiveTransformRef Matrix4x4?Draws the bitmap.
public void DrawBitmap(Bitmap bitmap, float opacity, InterpolationMode interpolationMode, Matrix4x4 perspectiveTransformRef)
bitmap BitmapThe bitmap.
opacity floatThe opacity.
interpolationMode InterpolationModeThe interpolation mode.
perspectiveTransformRef Matrix4x4The perspective transform ref.
Draws the bitmap.
public void DrawBitmap(Bitmap bitmap, float opacity, InterpolationMode interpolationMode, RectF sourceRectangle, Matrix4x4 perspectiveTransformRef)
bitmap BitmapThe bitmap.
opacity floatThe opacity.
interpolationMode InterpolationModeThe interpolation mode.
sourceRectangle RectFThe source rectangle.
perspectiveTransformRef Matrix4x4The perspective transform ref.
Draws the bitmap.
public void DrawBitmap(Bitmap bitmap, float opacity, InterpolationMode interpolationMode)
bitmap BitmapThe bitmap.
opacity floatThe opacity.
interpolationMode InterpolationModeThe interpolation mode.
void ID2D1DeviceContext::DrawGdiMetafile([In] ID2D1GdiMetafile* gdiMetafile,[In, Optional] const D2D_POINT_2F* targetOffset)
public void DrawGdiMetafile(GdiMetafile gdiMetafile, Point2F? targetOffset)
gdiMetafile GdiMetafiletargetOffset Point2F?void ID2D1DeviceContext::DrawGlyphRun([In] D2D_POINT_2F baselineOrigin,[In] const DWRITE_GLYPH_RUN* glyphRun,[In, Optional] const DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription,[In] ID2D1Brush* foregroundBrush,[In] DWRITE_MEASURING_MODE measuringMode)
public void DrawGlyphRun(Point2F baselineOrigin, GlyphRun glyphRun, GlyphRunDescription glyphRunDescription, Brush foregroundBrush, MeasuringMode measuringMode)
baselineOrigin Point2FglyphRun GlyphRunglyphRunDescription GlyphRunDescriptionforegroundBrush BrushmeasuringMode MeasuringModevoid ID2D1DeviceContext::DrawGlyphRun([In] D2D_POINT_2F baselineOrigin,[In] const DWRITE_GLYPH_RUN* glyphRun,[In, Optional] const DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription,[In] ID2D1Brush* foregroundBrush,[In] DWRITE_MEASURING_MODE measuringMode)
public void DrawGlyphRun(Point2F baselineOrigin, IntPtr glyphRun, IntPtr glyphRunDescription, Brush foregroundBrush, MeasuringMode measuringMode)
baselineOrigin Point2FglyphRun System.IntPtrglyphRunDescription System.IntPtrforegroundBrush BrushmeasuringMode MeasuringModeDraws an image to the device context.
public void DrawImage(Effect effect, InterpolationMode interpolationMode = InterpolationMode.Linear, CompositeMode compositeMode = CompositeMode.SourceOver)
effect EffectinterpolationMode InterpolationModecompositeMode CompositeModeDraws an image to the device context.
public void DrawImage(Effect effect, Point2F targetOffset, InterpolationMode interpolationMode = InterpolationMode.Linear, CompositeMode compositeMode = CompositeMode.SourceOver)
effect EffecttargetOffset Point2FinterpolationMode InterpolationModecompositeMode CompositeModeDraws an image to the device context.
public void DrawImage(Image image, InterpolationMode interpolationMode = InterpolationMode.Linear, CompositeMode compositeMode = CompositeMode.SourceOver)
image ImageinterpolationMode InterpolationModecompositeMode CompositeModeDraws an image to the device context.
public void DrawImage(Image image, Point2F targetOffset, InterpolationMode interpolationMode = InterpolationMode.Linear, CompositeMode compositeMode = CompositeMode.SourceOver)
image ImagetargetOffset Point2FinterpolationMode InterpolationModecompositeMode CompositeModevoid ID2D1DeviceContext::DrawImage([In] ID2D1Image* image,[In, Optional] const D2D_POINT_2F* targetOffset,[In, Optional] const D2D_RECT_F* imageRectangle,[In] D2D1_INTERPOLATION_MODE interpolationMode,[In] D2D1_COMPOSITE_MODE compositeMode)
public void DrawImage(Image image, Point2F? targetOffset, RectF? imageRectangle, InterpolationMode interpolationMode, CompositeMode compositeMode)
image ImagetargetOffset Point2F?imageRectangle RectF?interpolationMode InterpolationModecompositeMode CompositeModevoid ID2D1DeviceContext::FillOpacityMask([In] ID2D1Bitmap* opacityMask,[In] ID2D1Brush* brush,[In, Optional] const D2D_RECT_F* destinationRectangle,[In, Optional] const D2D_RECT_F* sourceRectangle)
public void FillOpacityMask(Bitmap opacityMask, Brush brush, RectF? destinationRectangle, RectF? sourceRectangle)
No documentation.
public void FillOpacityMask(Bitmap opacityMask, Brush brush)
void ID2D1DeviceContext::GetDevice([Out] ID2D1Device** device)
public Device GetDevice()
HRESULT ID2D1DeviceContext::GetEffectInvalidRectangleCount([In] ID2D1Effect* effect,[Out] unsigned int* rectangleCount)
public int GetEffectInvalidRectangleCount(Effect effect)
effect EffectHRESULT ID2D1DeviceContext::GetEffectInvalidRectangles([In] ID2D1Effect* effect,[Out, Buffer] D2D_RECT_F* rectangles,[In] unsigned int rectanglesCount)
public void GetEffectInvalidRectangles(Effect effect, RectF[] rectangles, int rectanglesCount)
Gets the effect invalid rectangles.
public RectF[] GetEffectInvalidRectangles(Effect effect)
effect EffectThe effect.
Gets the effect required input rectangles.
public RectF[] GetEffectRequiredInputRectangles(Effect renderEffect, EffectInputDescription[] inputDescriptions)
renderEffect EffectThe render effect.
inputDescriptions EffectInputDescription[]The input descriptions.
Gets the effect required input rectangles.
public RectF[] GetEffectRequiredInputRectangles(Effect renderEffect, RectF renderImageRectangle, EffectInputDescription[] inputDescriptions)
renderEffect EffectThe render effect.
renderImageRectangle RectFThe render image rectangle.
inputDescriptions EffectInputDescription[]The input descriptions.
HRESULT ID2D1DeviceContext::GetEffectRequiredInputRectangles([In] ID2D1Effect* renderEffect,[In, Optional] const D2D_RECT_F* renderImageRectangle,[In, Buffer] const D2D1_EFFECT_INPUT_DESCRIPTION* inputDescriptions,[Out, Buffer] D2D_RECT_F* requiredInputRects,[In] unsigned int inputCount)
public void GetEffectRequiredInputRectangles(Effect renderEffect, RectF? renderImageRectangle, EffectInputDescription[] inputDescriptions, RectF[] requiredInputRects, int inputCount)
renderEffect EffectrenderImageRectangle RectF?inputDescriptions EffectInputDescription[]requiredInputRects RectF[]inputCount intHRESULT ID2D1DeviceContext::GetGlyphRunWorldBounds([In] D2D_POINT_2F baselineOrigin,[In] const DWRITE_GLYPH_RUN* glyphRun,[In] DWRITE_MEASURING_MODE measuringMode,[Out] D2D_RECT_F* bounds)
public RectF GetGlyphRunWorldBounds(Point2F baselineOrigin, GlyphRun glyphRun, MeasuringMode measuringMode)
baselineOrigin Point2FglyphRun GlyphRunmeasuringMode MeasuringModeHRESULT ID2D1DeviceContext::GetImageLocalBounds([In] ID2D1Image* image,[Out] D2D_RECT_F* localBounds)
public RectF GetImageLocalBounds(Image image)
image ImageHRESULT ID2D1DeviceContext::GetImageWorldBounds([In] ID2D1Image* image,[Out] D2D_RECT_F* worldBounds)
public RectF GetImageWorldBounds(Image image)
image ImageD2D1_PRIMITIVE_BLEND ID2D1DeviceContext::GetPrimitiveBlend()
public PrimitiveBlend GetPrimitiveBlend()
void ID2D1DeviceContext::GetRenderingControls([Out] D2D1_RENDERING_CONTROLS* renderingControls)
public RenderingControls GetRenderingControls()
void ID2D1DeviceContext::GetTarget([Out, Optional] ID2D1Image** image)
public Image GetTarget()
D2D1_UNIT_MODE ID2D1DeviceContext::GetUnitMode()
public UnitMode GetUnitMode()
HRESULT ID2D1DeviceContext::InvalidateEffectInputRectangle([In] ID2D1Effect* effect,[In] unsigned int input,[In] const D2D_RECT_F* inputRectangle)
public void InvalidateEffectInputRectangle(Effect effect, int input, RectF inputRectangle)
BOOL ID2D1DeviceContext::IsBufferPrecisionSupported([In] D2D1_BUFFER_PRECISION bufferPrecision)
public bool IsBufferPrecisionSupported(BufferPrecision bufferPrecision)
bufferPrecision BufferPrecisionBOOL ID2D1DeviceContext::IsDxgiFormatSupported([In] DXGI_FORMAT format)
public bool IsDxgiFormatSupported(Format format)
format Formatvoid ID2D1DeviceContext::PushLayer([In] const D2D1_LAYER_PARAMETERS1* layerParameters,[In, Optional] ID2D1Layer* layer)
public void PushLayer(ref LayerParameters1 layerParameters, Layer layer = null)
layerParameters LayerParameters1layer Layervoid ID2D1DeviceContext::SetPrimitiveBlend([In] D2D1_PRIMITIVE_BLEND primitiveBlend)
public void SetPrimitiveBlend(PrimitiveBlend primitiveBlend)
primitiveBlend PrimitiveBlendvoid ID2D1DeviceContext::SetRenderingControls([In] const D2D1_RENDERING_CONTROLS* renderingControls)
public void SetRenderingControls(RenderingControls renderingControls)
renderingControls RenderingControlsvoid ID2D1DeviceContext::SetTarget([In, Optional] ID2D1Image* image)
public void SetTarget(Image image)
image Imagevoid ID2D1DeviceContext::SetUnitMode([In] D2D1_UNIT_MODE unitMode)
public void SetUnitMode(UnitMode unitMode)
unitMode UnitModePerforms an explicit conversion from System.IntPtr to DeviceContext.
public static explicit operator DeviceContext(IntPtr nativePointer)
nativePointer System.IntPtr