RenderContextBase

StockSharp.Xaml.Charting.Rendering.Common

Defines the base class for IRenderContext2D implementors, allowing drawing, blitting and creation of pens and brushes on the RenderSurfaceBase

Implementiert: IRenderContext2D, IDisposable

Eigenschaften

Layers : RenderOperationLayers

Gets a collection of RenderOperationLayer layers, which allow rendering operations to be posted to a layered queue for later execution in order (and correct Z-ordering).

ViewportSize : Size

Gets the size of the current viewport for this render operation

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

ClipArea(IEnumerable<Tuple<Point, Point>>) : IEnumerable<Point>

Used internally to clip the area of a StackedMountainSeries to the viewport

lines
Collection of lines, which represent bounds of a polygon segment
ClipArea(IEnumerable<Point>, int, int) : IEnumerable<Point>

Used internally to clip a polygon or line-segment to the viewport

ClipLine(Point, Point, Size) : bool

Rückgabe: false if line is outside of visible area

ClipZeroLineForArea(double, bool) : double

Used internally: Clips the zero line (e.g. in mountain fills) to the viewport

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 from the Color

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

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
Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

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

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.
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 colors to apply to the vertical scanline
opacity
The opacity of the vertical scaline, 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
pt2
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, 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
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
DrawText(string, Rect, AlignmentX, AlignmentY, Color, float, string, FontWeight)

Draws text if it does not go outside

dstBoundingRect
alignY
foreColor
fontSize
text
fontFamily
fontWeight
alignX
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, limited by two line segments, e.g. as in a stacked mountain chart, using the specified IBrush2D

brush
The brush
lines
The list of lines representing polygon segments
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
pt1
pt2
gradientRotationAngle
The angle which the brush is rotated by
IsInBounds(Point) : bool

Returns true if the point is inside the viewport

SetPrimitvesCachingEnabled(bool)

enables/disables primitves chaching optimization ( Direct3D renderer only )