New to Telerik UI for WinForms? Start a free 30-day trial

Provides shared rendering and hit-testing behavior for parts of a spark element.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Type Parameters:

T

The spark element rendered by this draw part.

Syntax:

C#
public abstract class SparkDrawPart<T> : ISparkDrawPart where T : UISparkElement

Inheritance: objectSparkDrawPart<T>

Derived Classes: CartesianSparkGridLineAnnotationDrawPartCartesianSparkPlotBandAnnotationDrawPartSparkAxisDrawPartSparkSeriesDrawPart

Implements: ISparkDrawPart

Constructors

Initializes a draw part for an element using the specified renderer.

C#
public SparkDrawPart(T element, ISparkRenderer renderer)
Parameters:elementT

The spark element whose visual content this part draws.

rendererISparkRenderer

The renderer that supplies the drawing surface.

Properties

Gets the element.

C#
public T Element { get; }
Property Value:

The element.

Gets the offset X.

C#
public virtual float OffsetX { get; }
Property Value:

The offset X.

Gets the offset Y.

C#
public virtual float OffsetY { get; }
Property Value:

The offset Y.

Gets the context object which will be painted as fill.

C#
public object PaintContext { get; }
Property Value:

The renderer.

Implements: ISparkDrawPart.PaintContext

Gets the renderer.

C#
public ISparkRenderer Renderer { get; }
Property Value:

The renderer.

Implements: ISparkDrawPart.Renderer

Gets the view port offset X.

C#
public virtual float ViewportOffsetX { get; }
Property Value:

The view port offset X.

Gets the view port offset Y.

C#
public virtual float ViewportOffsetY { get; }
Property Value:

The view port offset Y.

Methods

Draws this instance.

C#
public abstract void Draw()

Implements: ISparkDrawPart.Draw()

Gets the clipping bounds used when drawing this part.

C#
protected virtual RectangleF GetAdjustedClipRect(Graphics g)
Parameters:gGraphics

The graphics surface used for drawing.

Returns:

RectangleF

The graphics surface's current clip bounds.

Hits the test.

C#
public virtual SparkDataPoint HitTest(Point location)
Parameters:locationPoint

The location.

Returns:

SparkDataPoint

A data point hit at location, or null when this part has no hit.

Implements: ISparkDrawPart.HitTest(Point)

Determines whether the element is valid.

C#
protected virtual bool IsElementValid()
Returns:

bool

Raises the fill-paint event for path and fills it unless painting is canceled. The exact Transparent value is skipped.

C#
protected virtual void PaintFill(GraphicsPath path, Color fillColor)
Parameters:pathGraphicsPath

The path to fill.

fillColorColor

The fill color.

Fills path using the element's background color.

C#
protected virtual void PaintFill(GraphicsPath path)
Parameters:pathGraphicsPath

The path to fill.

Raises the stroke-paint event for path and draws the stroke unless painting is canceled. The exact Transparent value and zero-width strokes are skipped.

C#
protected virtual void PaintStroke(GraphicsPath path, Color borderColor, float width)
Parameters:pathGraphicsPath

The path to stroke.

borderColorColor

The stroke color.

widthfloat

The stroke width.

Draws path using borderColor and the element's BorderWidth.

C#
protected virtual void PaintStroke(GraphicsPath path, Color borderColor)
Parameters:pathGraphicsPath

The path to stroke.

borderColorColor

The stroke color.

Draws path using the element's border color and width.

C#
protected virtual void PaintStroke(GraphicsPath path)
Parameters:pathGraphicsPath

The path to stroke.