IRenderContext2D
Defines the interface to a 2D RenderContext, allowing drawing, blitting and creation of pens and brushes on the RenderSurfaceBase
Implementiert: IDisposable
Eigenschaften
Layers : RenderOperationLayers
Gets a collection of RenderOperationLayers, which allow rendering operations to be posted to a layered queue for later execution in order (and correct Z-ordering).
ViewportSize : Size
Gets the current size of the viewport.
Methoden
BeginLine(IPen2D, double, double) : IPathDrawingContext
Begins a Polyline segment, returning the IPathDrawingContext. This is the fastest way to draw lines and simply a proxy to Point}) method.
- pen
- The pen for the line segment
- startX
- The start X coordinate (pixel coord)
- startY
- The start Y coordinate (pixel coord)
Rückgabe: The IPathDrawingContext to continue the line
BeginPolygon(IBrush2D, double, double, double) : IPathDrawingContext
Begins a filled Polygon segment, returning the IPathDrawingContext. This is the fastest way to draw polygon and simply a proxy to Double) method.
- brush
- The brush for the polygon fill
- startX
- The start X coordinate (pixel coord)
- startY
- The start Y coordinate (pixel coord)
- gradientRotationAngle
- The angle which the brush is rotated by
Rückgabe: The IPathDrawingContext to continue the polygon
Clear()
Clears the IRenderSurface2D
CreateBrush(Color, double, bool?) : IBrush2D
Creates a IBrush2D valid for the current render pass. Use this to draw rectangles, polygons and shaded areas
- color
- The color of the brush, supports transparency
- opacity
- The opacity of the brush
- alphaBlend
- If true, use alphablending when shading. If null, auto-detect
Rückgabe: The IBrush2D instance
CreateBrush(Brush, double, TextureMappingMode) : IBrush2D
Creates a IBrush2D from WPF Brush valid for the current render pass. Use this to draw rectangles, polygons and shaded areas
- brush
- The WPF Brush to use as a source, e.g. this can be a , or it can be a . Note that solid colors support transparency and are faster than gradient brushes
- opacity
- The opacity of the brush
- textureMappingMode
- Defines a TextureMappingMode, e.g. brushes share a texture per viewport or a new texture per primitive drawn
Rückgabe: The IBrush2D instance
CreatePen(Color, bool, float, double, double[], PenLineCap) : IPen2D
Creates a IPen2D valid for the current render pass. Use this to draw outlines, quads and lines
- color
- The color of the pen, supports transparency
- antiAliasing
- If true, use antialiasing
- strokeThickness
- The strokethickness, default=1.0
- opacity
- The opecity of the pen
- strokeDashArray
- strokeEndLineCap
Rückgabe: The IPen2D instance
CreateSprite(FrameworkElement) : ISprite2D
Creates a Sprite from FrameworkElement by rendering to bitmap. This may be used in the Point) method to draw to the screen repeatedly
- fe
DigitMaxSize(float, string, FontWeight) : Size
max digit size in pixels
DisposeResourceAfterDraw(IDisposable)
Call this method, passing in IDisposable instance to dispose after the render pass completes. Called internally by Ultrachart to lazy-dispose of Direct2D and Direct3D brushes and textures
- disposable
DrawEllipse(IPen2D, IBrush2D, Point, double, double)
Draws an Ellipse on the IRenderSurface2D using the specified outline IPen2DPen and fill IBrush2DBrush
- strokePen
- The stroke pen
- fillBrush
- The fill brush
- center
- The center of the ellipse in pixels
- width
- The width of the ellipse in pixels
- height
- The height of the ellipse in pixels
DrawEllipses(IPen2D, IBrush2D, IEnumerable<Point>, double, double)
Draws 0..N Ellipses at the points passed in with the same width, height, pen and brush
- strokePen
- fillBrush
- centres
- The points to draw ellipses at
- width
- The common width for all ellipses
- height
- The common height for all ellipses
DrawLine(IPen2D, Point, Point)
Draws a single line on the IRenderSurface2D using the specified IPen2D. Note for a faster implementation in some rasterizers, use DrawLines passing in an IEnumerable
- pen
- The pen
- pt1
- The start of the line in pixels
- pt2
- The end of the line in pixels
DrawLines(IPen2D, IEnumerable<Point>)
Draws a multi-point line on the IRenderSurface2D using the specified IPen2D
- pen
- The pen
- points
- The points
Rückgabe: The last point in the polyline drawn
DrawPixelsVertically(int, int, int, IList<int>, double, bool)
Draws vertical scan line for heatmap from bottom to top, from yStart to yEnd
- x
- Screen X coordinate where to draw pixels
- yStartBottom
- Screen Y coordinate of vertical scan line's bottom. Can be located outdide of visible area, in this case not all pixels in list are rendered
- yEndTop
- Screen Y coordinate of vertical scan line's top. Can be located outdide of visible area, in this case not all pixels in list are rendered
- pixelColorsArgb
- The list of pixel colors to draw
- opacity
- The Opacity of the line from 0.0 to 1.0
- yAxisIsFlipped
- if set to true then y axis is flipped.
DrawQuad(IPen2D, Point, Point)
Draws a Quad on the IRenderSurface2D using the specified IPen2D
- pen
- The Pen
- pt1
- Left-top point in the quad
- pt2
- Bottom-right point in the quad
DrawSprite(ISprite2D, Rect, Point)
Blits the source image onto the IRenderSurface2D
- srcSprite
- The source sprite to render
- srcRect
- The source rectangle
- destPoint
- The destination point, which will be the top-left coordinate of the sprite after blitting
DrawSprites(ISprite2D, IEnumerable<Rect>)
Batch draw of the source sprite onto the IRenderSurface2D
- sprite2D
- The sprite to render
- dstRects
- The destination rectangles to draw sprites at
DrawSprites(ISprite2D, Rect, IEnumerable<Point>)
Batch draw of the source sprite onto the IRenderSurface2D
- sprite2D
- The sprite to render
- srcRect
- The source rectangle
- points
- The points to draw sprites at
DrawText(string, Rect, AlignmentX, AlignmentY, Color, float, string, FontWeight)
Draws text if it does not go outside
DrawText(string, Point, AlignmentX, AlignmentY, Color, float, string, FontWeight)
Draws text relative to base point
FillArea(IBrush2D, IEnumerable<Tuple<Point, Point>>, bool, double)
Fills an area defined the the Points and Heights, e.g. as in a mountain chart, using the specifie IBrush2D
- brush
- The brush
- lines
- isVerticalChart
- Value, indicates whether chart is vertical
- gradientRotationAngle
- The angle which the brush is rotated by
FillPolygon(IBrush2D, IEnumerable<Point>)
Fills a polygon on the IRenderSurface2D using the specifie IBrush2D
- brush
- The brush
- points
- The list of points defining the closed polygon, where X,Y coordinates in clockwise direction
FillRectangle(IBrush2D, Point, Point, double)
Fills a rectangle on the IRenderSurface2D using the specified IBrush2D
- brush
- The brush
- pt2
- The top-left point of the rectangle
- pt1
- The bottom-right point of the rectangle
- gradientRotationAngle
- The angle which the brush is rotated by, default is zero
SetPrimitvesCachingEnabled(bool)
enables/disables primitves chaching optimization ( Direct3D renderer only )
TextDrawDimensions(string, float, Color, float, float, string, FontWeight)
Calculate space needed to draw text