Loading...
Searching...
No Matches
OFT.Rendering.Context.RenderContext Class Referenceabstract

Represents an abstract rendering context for drawing on a chart. More...

Inheritance diagram for OFT.Rendering.Context.RenderContext:
[legend]
Collaboration diagram for OFT.Rendering.Context.RenderContext:
[legend]

Public Member Functions

int FillRectangle (Color brush1, Color brush2, Rectangle rect)
 Fills a rectangle with a gradient using two specified colors.
 
virtual int DrawFillRectangle (RenderPen pen, Color brush, Rectangle rect)
 Draws a filled rectangle with a specified pen and brush.
 
virtual int DrawFillRectangle (RenderPen pen, Color brush, Rectangle rect, int radius)
 Draws a filled rounded rectangle with a specified pen and brush.
 
virtual int FillHistogram (Color brush, Point[] points)
 Fills a histogram with a specified color.
 
virtual int SetTextRenderingHint (RenderTextRenderingHint textRenderingHint)
 Sets the text rendering hint for the rendering context.
 
abstract int SetInterpolationMode (RenderInterpolationModes interpolationMode)
 Sets the interpolation mode for drawing operations.
 
abstract int SetSmoothingMode (RenderSmoothingModes smoothingMode)
 Sets the smoothing mode for drawing operations.
 
abstract int DrawLine (RenderPen pen, int x1, int y1, int x2, int y2)
 Draws a line between two specified points using the given pen.
 
abstract int DrawLines (RenderPen pen, Point[] points)
 Draws a series of connected lines between multiple points using the given pen.
 
abstract int DrawRectangle (RenderPen pen, Rectangle rect)
 Draws a rectangle using the given pen and rectangle.
 
abstract int DrawRectangle (RenderPen pen, Rectangle rect, int radius)
 Draws a rounded rectangle using the given pen and rectangle.
 
abstract int DrawEllipse (RenderPen pen, Rectangle rect)
 Draws an ellipse using the given pen and bounding rectangle.
 
abstract int DrawPolygon (RenderPen pen, Point[] points)
 Draws a polygon using the given pen and array of points.
 
abstract int Clear (Color color)
 Clears the drawing area with the specified color.
 
abstract int FillRectangle (Color brush, Rectangle rect)
 Fills a rectangle using the specified brush and rectangle.
 
abstract int FillRectangle (Color brush, Rectangle rect, int radius)
 Fills a rounded rectangle by radius in pixels using the specified brush and rectangle.
 
abstract int FillRectangle (Color brush1, Color brush2, Rectangle rect, bool vertical)
 Fills a rectangle with a gradient using two specified brushes and the rectangle.
 
abstract int FillPolygon (Color brush, Point[] points)
 Fills a polygon using the specified brush and array of points.
 
abstract int FillPolygon (Color brushStart, Color brushEnd, Point[] points, bool vertical)
 Fills a polygon with a gradient using two specified brushes and the array of points.
 
abstract int FillEllipse (Color brush, Rectangle rect)
 Fills an ellipse using the specified brush and bounding rectangle.
 
abstract int FillPie (Color brush, Rectangle rect, float startAngle, float sweepAngle)
 Fills a pie-shaped area of an ellipse using the specified brush, bounding rectangle, start angle, and sweep angle.
 
abstract int DrawString (string s, RenderFont font, Color brush, int x, int y)
 Draws a string at the specified position using the specified font and brush.
 
abstract int DrawString (string s, RenderFont font, Color brush, int x, int y, RenderStringFormat format)
 Draws a string at the specified position using the specified font, brush, and string format.
 
abstract int DrawString (string s, RenderFont font, Color brush, Rectangle layoutRectangle)
 Draws a string within the specified layout rectangle using the specified font and brush.
 
abstract int DrawString (string s, RenderFont font, Color brush, Rectangle layoutRectangle, RenderStringFormat format)
 Draws a string within the specified layout rectangle using the specified font, brush, and string format.
 
abstract Size MeasureString (string text, RenderFont font)
 Measures the System.Drawing.Size of the specified text when drawn using the specified font.
 
abstract Rectangle MeasureStringWithOverhang (string text, RenderFont renderFont)
 Returns the smallest rectangle that the specified text will fit. The height of the rectangle will depend on the actual drawing characters.
 
abstract int DrawStaticImage (Image image, Rectangle dest)
 Draws a static image on the rendering context with the specified destination rectangle.
 
abstract int DrawStaticImage (IBitmapImage image, Rectangle dest)
 Draws a static image on the rendering context with the specified destination rectangle.
 
abstract int DrawLayout (DrawingLayout layout, Point point=new Point())
 Draws a specified DrawingLayout at the specified point on the rendering context.
 
abstract int SetClip (Rectangle rect)
 Sets the clipping region of the rendering context to the specified rectangle.
 
abstract int ResetClip ()
 Resets the clipping region of the rendering context to its original state.
 
abstract int TranslateTransform (int dx, int dy)
 Translates the origin of the rendering context by the specified distance in the x and y directions.
 
abstract RenderContext CreateLayoutRenderContext (DrawingLayout layout)
 Creates a new RenderContext of the specified layout size to draw to a bitmap. The layout system allows caching a batch of drawings into a bitmap and then not repainting them again (or reducing drawings).
 
virtual int DrawHeatmap (HeatmapControl heatmapControl, Rectangle dest)
 Draws a heatmap on the specified destination rectangle.
 
virtual int PrepareCachedHeatmap (HeatmapControl heatmapControl)
 Calculates and prepares heatmap to be drawn later with DrawCachedHeatmap
Cached heatmap can be drawn only for a single drawing context (single frame).
 
virtual int DrawCachedHeatmap (HeatmapControl heatmapControl, Rectangle dest)
 Draws prepared heatmap image. Call PrepareCachedHeatmap once before multiple calls of this method.
If you need to draw heatmap only once then use DrawHeatmap method.
 
virtual void BeginRender ()
 Begins the rendering process.
 
virtual void EndRender ()
 Ends the rendering process.
 
abstract int DrawSmoothedLine (RenderPen pen, Point[] points)
 
abstract int DrawQuadraticSpline (RenderPen pen, Point[] points)
 
Size MeasureString (string text, RenderFont font)
 Returns size of the text. Resulted height will be maximum of possible font height. Use when your text will change.
 
Rectangle MeasureStringWithOverhang (string text, RenderFont renderFont)
 Returns the smallest rectangle that text will fit. Height will depend on actual drawing characters.
 

Protected Member Functions

 RenderContext ()
 Initializes a new instance of the RenderContext class.
 

Properties

static bool UseTestFramework [get, set]
 Gets or sets a value indicating whether the rendering control will record all draw calls timing and display it on top of the image.
 
abstract Rectangle ClipBounds [get]
 Gets the bounds of the clip area for drawing.
 
Size Size [get, protected set]
 Gets or sets the size of the rendering context.
 
virtual float FontAntiAliasingMinSize [get, set]
 Gets or sets the minimum font size for anti-aliasing.
 
virtual bool IsValid [get]
 Gets a value indicating whether the rendering context is valid.
 
virtual IRenderContextSettings Settings = null! [get, protected set]
 Gets settings of a context that will perform final rendering.
 

Detailed Description

Represents an abstract rendering context for drawing on a chart.

This class serves as the base for specific implementations of rendering contexts, which define how the drawing methods are implemented based on the rendering platform or library being used.

Constructor & Destructor Documentation

◆ RenderContext()

OFT.Rendering.Context.RenderContext.RenderContext ( )
protected

Initializes a new instance of the RenderContext class.

Member Function Documentation

◆ BeginRender()

virtual void OFT.Rendering.Context.RenderContext.BeginRender ( )
virtual

Begins the rendering process.

◆ Clear()

abstract int OFT.Rendering.Context.RenderContext.Clear ( Color  color)
pure virtual

Clears the drawing area with the specified color.

Parameters
colorThe color used to clear the drawing area.
Returns
The result of clearing the drawing area.

◆ CreateLayoutRenderContext()

abstract RenderContext OFT.Rendering.Context.RenderContext.CreateLayoutRenderContext ( DrawingLayout  layout)
pure virtual

Creates a new RenderContext of the specified layout size to draw to a bitmap. The layout system allows caching a batch of drawings into a bitmap and then not repainting them again (or reducing drawings).

Parameters
layoutThe DrawingLayout specifying the size and layout of the new RenderContext.
Returns
A new RenderContext instance for the specified layout.

◆ DrawCachedHeatmap()

virtual int OFT.Rendering.Context.RenderContext.DrawCachedHeatmap ( HeatmapControl  heatmapControl,
Rectangle  dest 
)
virtual

Draws prepared heatmap image. Call PrepareCachedHeatmap once before multiple calls of this method.
If you need to draw heatmap only once then use DrawHeatmap method.

Parameters
heatmapControlThe HeatmapControl containing the heatmap data.
destThe destination rectangle where the heatmap will be drawn.
Returns
An integer value representing the result of the drawing operation.

◆ DrawEllipse()

abstract int OFT.Rendering.Context.RenderContext.DrawEllipse ( RenderPen  pen,
Rectangle  rect 
)
pure virtual

Draws an ellipse using the given pen and bounding rectangle.

Parameters
penThe pen used to draw the ellipse outline.
rectThe bounding rectangle of the ellipse.
Returns
The result of drawing the ellipse.

◆ DrawFillRectangle() [1/2]

virtual int OFT.Rendering.Context.RenderContext.DrawFillRectangle ( RenderPen  pen,
Color  brush,
Rectangle  rect 
)
virtual

Draws a filled rectangle with a specified pen and brush.

Parameters
penThe pen used to draw the rectangle outline.
brushThe brush used to fill the rectangle.
rectThe rectangle to draw and fill.
Returns
The result of the draw operation.

◆ DrawFillRectangle() [2/2]

virtual int OFT.Rendering.Context.RenderContext.DrawFillRectangle ( RenderPen  pen,
Color  brush,
Rectangle  rect,
int  radius 
)
virtual

Draws a filled rounded rectangle with a specified pen and brush.

Parameters
pen
brush
rect
radius

◆ DrawHeatmap()

virtual int OFT.Rendering.Context.RenderContext.DrawHeatmap ( HeatmapControl  heatmapControl,
Rectangle  dest 
)
virtual

Draws a heatmap on the specified destination rectangle.

Parameters
heatmapControlThe HeatmapControl containing the heatmap data.
destThe destination rectangle where the heatmap will be drawn.
Returns
An integer value representing the result of the drawing operation.

◆ DrawLayout()

abstract int OFT.Rendering.Context.RenderContext.DrawLayout ( DrawingLayout  layout,
Point  point = new Point() 
)
pure virtual

Draws a specified DrawingLayout at the specified point on the rendering context.

Parameters
layoutThe DrawingLayout object to draw.
pointThe location where the drawing layout will be drawn on the rendering context. (optional, default is Point.Empty)
Returns
The result of the draw operation.

◆ DrawLine()

abstract int OFT.Rendering.Context.RenderContext.DrawLine ( RenderPen  pen,
int  x1,
int  y1,
int  x2,
int  y2 
)
pure virtual

Draws a line between two specified points using the given pen.

Parameters
penThe pen used to draw the line.
x1The x-coordinate of the starting point.
y1The y-coordinate of the starting point.
x2The x-coordinate of the ending point.
y2The y-coordinate of the ending point.
Returns
The result of drawing the line.

◆ DrawLines()

abstract int OFT.Rendering.Context.RenderContext.DrawLines ( RenderPen  pen,
Point[]  points 
)
pure virtual

Draws a series of connected lines between multiple points using the given pen.

Parameters
penThe pen used to draw the lines.
pointsAn array of points defining the lines.
Returns
The result of drawing the lines.

◆ DrawPolygon()

abstract int OFT.Rendering.Context.RenderContext.DrawPolygon ( RenderPen  pen,
Point[]  points 
)
pure virtual

Draws a polygon using the given pen and array of points.

Parameters
penThe pen used to draw the polygon outline.
pointsAn array of points defining the vertices of the polygon.
Returns
The result of drawing the polygon.

◆ DrawQuadraticSpline()

abstract int OFT.Rendering.Context.RenderContext.DrawQuadraticSpline ( RenderPen  pen,
Point[]  points 
)
pure virtual

◆ DrawRectangle() [1/2]

abstract int OFT.Rendering.Context.RenderContext.DrawRectangle ( RenderPen  pen,
Rectangle  rect 
)
pure virtual

Draws a rectangle using the given pen and rectangle.

Parameters
penThe pen used to draw the rectangle outline.
rectThe rectangle to draw.
Returns
The result of drawing the rectangle.

◆ DrawRectangle() [2/2]

abstract int OFT.Rendering.Context.RenderContext.DrawRectangle ( RenderPen  pen,
Rectangle  rect,
int  radius 
)
pure virtual

Draws a rounded rectangle using the given pen and rectangle.

Parameters
penThe pen used to draw the rectangle outline.
rectThe rectangle to draw.
radiusThe rectangle corners radius.
Returns
The result of drawing the rectangle.

◆ DrawSmoothedLine()

abstract int OFT.Rendering.Context.RenderContext.DrawSmoothedLine ( RenderPen  pen,
Point[]  points 
)
pure virtual

◆ DrawStaticImage() [1/2]

abstract int OFT.Rendering.Context.RenderContext.DrawStaticImage ( IBitmapImage  image,
Rectangle  dest 
)
pure virtual

Draws a static image on the rendering context with the specified destination rectangle.

Parameters
imageThe IBitmapImage to draw.
destThe destination rectangle where the image will be drawn.
Returns

◆ DrawStaticImage() [2/2]

abstract int OFT.Rendering.Context.RenderContext.DrawStaticImage ( Image  image,
Rectangle  dest 
)
pure virtual

Draws a static image on the rendering context with the specified destination rectangle.

Parameters
imageThe image to draw.
destThe destination rectangle where the image will be drawn.
Returns
The result of the draw operation.

◆ DrawString() [1/4]

abstract int OFT.Rendering.Context.RenderContext.DrawString ( string  s,
RenderFont  font,
Color  brush,
int  x,
int  y 
)
pure virtual

Draws a string at the specified position using the specified font and brush.

Parameters
sThe string to draw.
fontThe font used for drawing the string.
brushThe brush used to draw the string.
xThe x-coordinate of the starting position.
yThe y-coordinate of the starting position.
Returns
The result of drawing the string.

◆ DrawString() [2/4]

abstract int OFT.Rendering.Context.RenderContext.DrawString ( string  s,
RenderFont  font,
Color  brush,
int  x,
int  y,
RenderStringFormat  format 
)
pure virtual

Draws a string at the specified position using the specified font, brush, and string format.

Parameters
sThe string to draw.
fontThe font used for drawing the string.
brushThe brush used to draw the string.
xThe x-coordinate of the starting position.
yThe y-coordinate of the starting position.
formatThe string format to apply during drawing.
Returns
The result of drawing the string.

◆ DrawString() [3/4]

abstract int OFT.Rendering.Context.RenderContext.DrawString ( string  s,
RenderFont  font,
Color  brush,
Rectangle  layoutRectangle 
)
pure virtual

Draws a string within the specified layout rectangle using the specified font and brush.

Parameters
sThe string to draw.
fontThe font used for drawing the string.
brushThe brush used to draw the string.
layoutRectangleThe layout rectangle to constrain the drawing area.
Returns
The result of drawing the string.

◆ DrawString() [4/4]

abstract int OFT.Rendering.Context.RenderContext.DrawString ( string  s,
RenderFont  font,
Color  brush,
Rectangle  layoutRectangle,
RenderStringFormat  format 
)
pure virtual

Draws a string within the specified layout rectangle using the specified font, brush, and string format.

Parameters
sThe string to draw.
fontThe font used for drawing the string.
brushThe brush used to draw the string.
layoutRectangleThe layout rectangle to constrain the drawing area.
formatThe string format to apply during drawing.
Returns
The result of drawing the string.

◆ EndRender()

virtual void OFT.Rendering.Context.RenderContext.EndRender ( )
virtual

Ends the rendering process.

◆ FillEllipse()

abstract int OFT.Rendering.Context.RenderContext.FillEllipse ( Color  brush,
Rectangle  rect 
)
pure virtual

Fills an ellipse using the specified brush and bounding rectangle.

Parameters
brushThe brush used to fill the ellipse.
rectThe bounding rectangle of the ellipse.
Returns
The result of filling the ellipse.

◆ FillHistogram()

virtual int OFT.Rendering.Context.RenderContext.FillHistogram ( Color  brush,
Point[]  points 
)
virtual

Fills a histogram with a specified color.

Parameters
brushThe brush used to fill the histogram.
pointsThe array of points that define the histogram shape.
Returns
The result of the fill operation.

◆ FillPie()

abstract int OFT.Rendering.Context.RenderContext.FillPie ( Color  brush,
Rectangle  rect,
float  startAngle,
float  sweepAngle 
)
pure virtual

Fills a pie-shaped area of an ellipse using the specified brush, bounding rectangle, start angle, and sweep angle.

Parameters
brushThe brush used to fill the pie.
rectThe bounding rectangle of the ellipse.
startAngleThe start angle in degrees.
sweepAngleThe sweep angle in degrees.
Returns
The result of filling the pie.

◆ FillPolygon() [1/2]

abstract int OFT.Rendering.Context.RenderContext.FillPolygon ( Color  brush,
Point[]  points 
)
pure virtual

Fills a polygon using the specified brush and array of points.

Parameters
brushThe brush used to fill the polygon.
pointsAn array of points defining the vertices of the polygon.
Returns
The result of filling the polygon.

◆ FillPolygon() [2/2]

abstract int OFT.Rendering.Context.RenderContext.FillPolygon ( Color  brushStart,
Color  brushEnd,
Point[]  points,
bool  vertical 
)
pure virtual

Fills a polygon with a gradient using two specified brushes and the array of points.

Parameters
brushStartThe first brush used for the start of the gradient.
brushEndThe second brush used for the end of the gradient.
pointsAn array of points defining the vertices of the polygon.
verticalSpecifies whether the gradient should be vertical (true) or horizontal (false).
Returns
The result of filling the polygon with the gradient.

◆ FillRectangle() [1/4]

abstract int OFT.Rendering.Context.RenderContext.FillRectangle ( Color  brush,
Rectangle  rect 
)
pure virtual

Fills a rectangle using the specified brush and rectangle.

Parameters
brushThe brush used to fill the rectangle.
rectThe rectangle to fill.
Returns
The result of filling the rectangle.

◆ FillRectangle() [2/4]

abstract int OFT.Rendering.Context.RenderContext.FillRectangle ( Color  brush,
Rectangle  rect,
int  radius 
)
pure virtual

Fills a rounded rectangle by radius in pixels using the specified brush and rectangle.

Parameters
brush
rect
radius
Returns

◆ FillRectangle() [3/4]

int OFT.Rendering.Context.RenderContext.FillRectangle ( Color  brush1,
Color  brush2,
Rectangle  rect 
)

Fills a rectangle with a gradient using two specified colors.

Parameters
brush1The first color of the gradient.
brush2The second color of the gradient.
rectThe rectangle to fill.
Returns
The result of the fill operation.

◆ FillRectangle() [4/4]

abstract int OFT.Rendering.Context.RenderContext.FillRectangle ( Color  brush1,
Color  brush2,
Rectangle  rect,
bool  vertical 
)
pure virtual

Fills a rectangle with a gradient using two specified brushes and the rectangle.

Parameters
brush1The first brush used for the start of the gradient.
brush2The second brush used for the end of the gradient.
rectThe rectangle to fill.
verticalSpecifies whether the gradient should be vertical (true) or horizontal (false).
Returns
The result of filling the rectangle with the gradient.

◆ MeasureString()

abstract Size OFT.Rendering.Context.RenderContext.MeasureString ( string  text,
RenderFont  font 
)
pure virtual

Measures the System.Drawing.Size of the specified text when drawn using the specified font.

Parameters
textThe text to measure.
fontThe font used for measuring the text.
Returns
The size of the text when drawn with the specified font.

Implements OFT.Rendering.Context.IStringMeasure.

◆ MeasureStringWithOverhang()

abstract Rectangle OFT.Rendering.Context.RenderContext.MeasureStringWithOverhang ( string  text,
RenderFont  renderFont 
)
pure virtual

Returns the smallest rectangle that the specified text will fit. The height of the rectangle will depend on the actual drawing characters.

Parameters
textThe text to measure.
renderFontThe font used for measuring the text.
Returns
The smallest rectangle that the text will fit.

Implements OFT.Rendering.Context.IStringMeasure.

◆ PrepareCachedHeatmap()

virtual int OFT.Rendering.Context.RenderContext.PrepareCachedHeatmap ( HeatmapControl  heatmapControl)
virtual

Calculates and prepares heatmap to be drawn later with DrawCachedHeatmap
Cached heatmap can be drawn only for a single drawing context (single frame).

Parameters
heatmapControlThe HeatmapControl containing the heatmap data.
Returns
An integer value representing the result of the preparation operation.

◆ ResetClip()

abstract int OFT.Rendering.Context.RenderContext.ResetClip ( )
pure virtual

Resets the clipping region of the rendering context to its original state.

Returns
The result of the reset clip operation.

◆ SetClip()

abstract int OFT.Rendering.Context.RenderContext.SetClip ( Rectangle  rect)
pure virtual

Sets the clipping region of the rendering context to the specified rectangle.

Parameters
rectThe rectangle to set as the clipping region.
Returns
The result of the set clip operation.

◆ SetInterpolationMode()

abstract int OFT.Rendering.Context.RenderContext.SetInterpolationMode ( RenderInterpolationModes  interpolationMode)
pure virtual

Sets the interpolation mode for drawing operations.

Parameters
interpolationModeThe interpolation mode to set.
Returns
The result of setting the interpolation mode.

◆ SetSmoothingMode()

abstract int OFT.Rendering.Context.RenderContext.SetSmoothingMode ( RenderSmoothingModes  smoothingMode)
pure virtual

Sets the smoothing mode for drawing operations.

Parameters
smoothingModeThe smoothing mode to set.
Returns
The result of setting the smoothing mode.

◆ SetTextRenderingHint()

virtual int OFT.Rendering.Context.RenderContext.SetTextRenderingHint ( RenderTextRenderingHint  textRenderingHint)
virtual

Sets the text rendering hint for the rendering context.

Parameters
textRenderingHintThe text rendering hint to set.
Returns
The result of setting the text rendering hint.

◆ TranslateTransform()

abstract int OFT.Rendering.Context.RenderContext.TranslateTransform ( int  dx,
int  dy 
)
pure virtual

Translates the origin of the rendering context by the specified distance in the x and y directions.

Parameters
dxThe distance to translate in the x direction.
dyThe distance to translate in the y direction.
Returns
The result of the translation transform operation.

Property Documentation

◆ ClipBounds

abstract Rectangle OFT.Rendering.Context.RenderContext.ClipBounds
get

Gets the bounds of the clip area for drawing.

◆ FontAntiAliasingMinSize

virtual float OFT.Rendering.Context.RenderContext.FontAntiAliasingMinSize
getset

Gets or sets the minimum font size for anti-aliasing.

◆ IsValid

virtual bool OFT.Rendering.Context.RenderContext.IsValid
get

Gets a value indicating whether the rendering context is valid.

◆ Settings

virtual IRenderContextSettings OFT.Rendering.Context.RenderContext.Settings = null!
getprotected set

Gets settings of a context that will perform final rendering.

◆ Size

Size OFT.Rendering.Context.RenderContext.Size
getprotected set

Gets or sets the size of the rendering context.

◆ UseTestFramework

bool OFT.Rendering.Context.RenderContext.UseTestFramework
staticgetset

Gets or sets a value indicating whether the rendering control will record all draw calls timing and display it on top of the image.


The documentation for this class was generated from the following file: