RenderContextBase

StockSharp.Xaml.Charting.Rendering.Common

定义 IRenderContext2D 执行器的基类,允许在 RenderSurfaceBase 上绘制、打字并创建笔和刷子

实现: IRenderContext2D, IDisposable

属性

Layers
public abstract RenderOperationLayers Layers { get; }
value = renderContextBase.Layers

获得RenderOperationLayer层的集合,可以将渲染操作放入分层的队列,以便后期执行顺序(并正确Z-顺序).

ViewportSize
public abstract Size ViewportSize { get; }
value = renderContextBase.ViewportSize

获取当前此渲染操作的视图端口大小

方法

BeginLine
public abstract IPathDrawingContext BeginLine(IPen2D pen, double startX, double startY)
result = renderContextBase.BeginLine(pen, startX, startY)

开始一个多线段, 返回 IPathDrawingContext 。 这是绘制线条的最快方式, 并且只是 Point 的代理 。

pen
线段的笔
startX
起始 X 坐标( 像素coord)
startY
起始 Y 坐标( 像素coord)

返回值: IPathDrawingContext号继续行驶

BeginPolygon
public abstract IPathDrawingContext BeginPolygon(IBrush2D brush, double startX, double startY, double gradientRotationAngle)
result = renderContextBase.BeginPolygon(brush, startX, startY, gradientRotationAngle)

开始一个已填充的多边形段, 返回 IPathDrawingContext 。 这是绘制多边形的最快方式, 并且只是向 Double 方法的代理 。

brush
多边形填充的刷子
startX
起始 X 坐标( 像素coord)
startY
起始 Y 坐标( 像素coord)
gradientRotationAngle
刷子旋转的角度

返回值: IPathDrawingContext 继续多边形

Clear
public abstract void Clear()
renderContextBase.Clear()

Clears the IRenderSurface2D

ClipArea
protected IEnumerable<Point> ClipArea(IEnumerable<Tuple<Point, Point>> lines)
result = renderContextBase.ClipArea(lines)

内部用来将 StackedMountainSeries 区域剪接到视图端口

lines
表示多边形部分的界限的行集
ClipArea
protected IEnumerable<Point> ClipArea(IEnumerable<Point> points, int xExtension, int yExtension)
result = renderContextBase.ClipArea(points, xExtension, yExtension)

用于在视图端口内剪接多边形或线段

ClipLine
internal static bool ClipLine(Point pt1, Point pt2, Size viewportSize)
result = RenderContextBase.ClipLine(pt1, pt2, viewportSize)

返回值: 如果行在可见区域之外, 则不实

ClipZeroLineForArea
protected double ClipZeroLineForArea(double zeroLine, bool isVerticalChart)
result = renderContextBase.ClipZeroLineForArea(zeroLine, isVerticalChart)

内部使用:将零行(%% e.g+%. in mountry fills)剪接到取景口

CreateBrush
public abstract IBrush2D CreateBrush(Color color, double opacity, bool? alphaBlend)
result = renderContextBase.CreateBrush(color, opacity, alphaBlend)

创建当前渲染通过有效的 IBrush2D。 使用它绘制矩形、 多边形和阴影区域

color
刷子的颜色, 支持透明
opacity
刷子的不透明
alphaBlend
如果为真, 在阴影时使用字母缩写。 如果无效, 自动从颜色中检测

返回值: IBrush2D 实例

CreateBrush
public abstract IBrush2D CreateBrush(Brush brush, double opacity, TextureMappingMode textureMappingMode)
result = renderContextBase.CreateBrush(brush, opacity, textureMappingMode)

创建一个 WPF 刷子的 IBrush2D , 用于当前渲染传出。 使用此选项绘制矩形、 多边形和阴影区域

brush
将 WPF 刷用作源的 e.g 。 它可以是一个,也可以是一个。 请注意, 固态颜色支持透明性, 并且比梯度刷快 。
opacity
刷子的不透明
textureMappingMode

返回值: IBrush2D 实例

CreatePen
public abstract IPen2D CreatePen(Color color, bool antiAliasing, float strokeThickness, double opacity, double[] strokeDashArray, PenLineCap strokeEndLineCap)
result = renderContextBase.CreatePen(color, antiAliasing, strokeThickness, opacity, strokeDashArray, strokeEndLineCap)

创建当前渲染通过有效的 IPen2D。 使用此选项绘制大纲、 四和行

color
笔的颜色, 支持透明
antiAliasing
如果真有,请使用反异名
strokeThickness
中风, 默认为1.0
opacity
笔的活性
strokeDashArray
strokeEndLineCap

返回值: IPen2D 实例

CreateSprite
public abstract ISprite2D CreateSprite(FrameworkElement fe)
result = renderContextBase.CreateSprite(fe)

通过渲染到位图来创建 Sprite。 可以在点中使用, 来反复向屏幕绘制 。

fe
Dispose
public abstract void Dispose()
renderContextBase.Dispose()

执行与释放、释放或重置未管理资源相关的应用程序定义的任务。

DisposeResourceAfterDraw
public abstract void DisposeResourceAfterDraw(IDisposable disposable)
renderContextBase.DisposeResourceAfterDraw(disposable)

调用这种方法, 在可处理实例中通过, 以在完成渲染后处理 。 由 Ultrachart 内部调用, 以懒惰的方式处理 Direct2D 和 Direct3D 刷和纹理

disposable
DrawEllipse
public abstract void DrawEllipse(IPen2D strokePen, IBrush2D fillBrush, Point center, double width, double height)
renderContextBase.DrawEllipse(strokePen, fillBrush, center, width, height)

使用指定的 IPen2D 大纲绘制 IRenderSurface2D 上的椭圆并填入 IBrush2D

strokePen
中风笔
fillBrush
刷子上画的
center
椭圆中心以像素表示
width
椭圆以像素表示的宽度
height
椭圆高度, 像素
DrawEllipses
public abstract void DrawEllipses(IPen2D strokePen, IBrush2D fillBrush, IEnumerable<Point> centres, double width, double height)
renderContextBase.DrawEllipses(strokePen, fillBrush, centres, width, height)

在宽度、高度、笔和刷子相同的点上绘制 0.N 椭圆

strokePen
fillBrush
centres
绘制椭圆的点数
width
所有椭圆的通宽度
height
所有椭圆的通用高度
DrawLine
public virtual void DrawLine(IPen2D pen, Point pt1, Point pt2)
renderContextBase.DrawLine(pen, pt1, pt2)

在 IRenderSurface2D 上使用指定的 IPen2D 绘制一行。 在一些光栅机中更快执行的注意, 请使用 DrawLines

pen
pt1
线条的起始像素
pt2
线的结束, 以像素为单位
DrawLines
public virtual void DrawLines(IPen2D pen, IEnumerable<Point> points)
renderContextBase.DrawLines(pen, points)

使用指定的 IPen2D 在 IRenderSurface2D 上绘制多点线

pen
points
分数.
DrawPixelsVertically
public abstract void DrawPixelsVertically(int x, int yStartBottom, int yEndTop, IList<int> pixelColorsArgb, double opacity, bool yAxisIsFlipped)
renderContextBase.DrawPixelsVertically(x, yStartBottom, yEndTop, pixelColorsArgb, opacity, yAxisIsFlipped)

从下到上绘制取暖图的垂直扫描线,从% yStart+++到% yEnd++++

x
屏幕 X 坐标到何处绘制像素
yStartBottom
垂直扫描行底部的屏幕 Y 坐标。 可以定位可见区域外, 在此情况下, 列表中并非所有像素都得到 。
yEndTop
屏幕 Y 垂直扫描线上方坐标。 可以定位可见区域外, 此处不提供列表中的所有像素
pixelColorsArgb
垂直扫描线要应用的颜色
opacity
垂直分层的不透明度, 从 0.0 到 1.0
yAxisIsFlipped
如果设置为真,则将 Y 轴翻转。
DrawQuad
public virtual void DrawQuad(IPen2D pen, Point pt1, Point pt2)
renderContextBase.DrawQuad(pen, pt1, pt2)

使用指定的 IPen2D 在 IRenderSurface2D 上绘制一个 Quad

pen
笔会
pt1
pt2
DrawSprite
public abstract void DrawSprite(ISprite2D srcSprite, Rect srcRect, Point destPoint)
renderContextBase.DrawSprite(srcSprite, srcRect, destPoint)

将源图像打碎到 IRenderSurface2D 上

srcSprite
要渲染的源图示
srcRect
源矩形
destPoint
目的地, 这将是闪烁后图示左上角坐标
DrawSprites
public abstract void DrawSprites(ISprite2D sprite2D, Rect srcRect, IEnumerable<Point> points)
renderContextBase.DrawSprites(sprite2D, srcRect, points)

将源图示的批量绘图到 IRenderSurface2D

sprite2D
拟制成的图案
srcRect
源矩形
points
要绘制的点数
DrawSprites
public abstract void DrawSprites(ISprite2D sprite2D, IEnumerable<Rect> dstRects)
renderContextBase.DrawSprites(sprite2D, dstRects)

将源图示的批量绘图到 IRenderSurface2D

sprite2D
拟制成的图案
dstRects
目的地矩形以图示绘制于
DrawText
public void DrawText(string text, Rect dstBoundingRect, AlignmentX alignX, AlignmentY alignY, Color foreColor, float fontSize, string fontFamily, FontWeight fontWeight)
renderContextBase.DrawText(text, dstBoundingRect, alignX, alignY, foreColor, fontSize, fontFamily, fontWeight)

如果文字不外出, 则绘制文字

dstBoundingRect
alignY
foreColor
fontSize
text
fontFamily
fontWeight
alignX
DrawText
public void DrawText(string text, Point basePoint, AlignmentX alignX, AlignmentY alignY, Color foreColor, float fontSize, string fontFamily, FontWeight fontWeight)
renderContextBase.DrawText(text, basePoint, alignX, alignY, foreColor, fontSize, fontFamily, fontWeight)

绘制相对于基准点的文字

FillArea
public abstract void FillArea(IBrush2D brush, IEnumerable<Tuple<Point, Point>> lines, bool isVerticalChart, double gradientRotationAngle)
renderContextBase.FillArea(brush, lines, isVerticalChart, gradientRotationAngle)

填入一个区域, 以两个行段为限制 e.g. 如叠叠的山图, 使用指定的 IBrush2D

brush
刷子 刷子 刷子
lines
代表多边形片段的行列表
isVerticalChart
值,表示图表是否为垂直
gradientRotationAngle
刷子旋转的角度
FillPolygon
public virtual void FillPolygon(IBrush2D brush, IEnumerable<Point> points)
renderContextBase.FillPolygon(brush, points)

使用 Specifie IBrush2D 填入 IRenderSurface2D 上的多边形

brush
刷子 刷子 刷子
points
定义闭合多边形的点列表, X, Y 以顺时针方向坐标
FillRectangle
public abstract void FillRectangle(IBrush2D brush, Point pt1, Point pt2, double gradientRotationAngle)
renderContextBase.FillRectangle(brush, pt1, pt2, gradientRotationAngle)

使用指定的 IBrush2D 填入 IRenderSurface2D 上的矩形

brush
刷子 刷子 刷子
pt1
pt2
gradientRotationAngle
刷子旋转的角度
IsInBounds
protected bool IsInBounds(Point pt)
result = renderContextBase.IsInBounds(pt)

如果点位于视图端口内, 返回真实性

SetPrimitvesCachingEnabled
public virtual void SetPrimitvesCachingEnabled(bool bEnabled)
renderContextBase.SetPrimitvesCachingEnabled(bEnabled)

允许/ 允许 primites 硬盘优化( 仅直接3D 渲染器)