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

Base implementation that tracks clip bounds and scale factors while delegating drawing to a backend.

Definition

Namespace:Telerik.WinControls.Spreadsheet.UI

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public abstract class PaintingContext : IPaintingContext

Inheritance: objectPaintingContext

Derived Classes: GDIPaintingContext

Implements: IPaintingContext

Constructors

C#
protected PaintingContext()

Properties

Gets or sets the clip bounds exposed to painting code.

C#
public RectangleF ClipBounds { get; set; }

Implements: IPaintingContext.ClipBounds

Setting this property stores the bounds only; it does not change the graphics surface's clipping region. GDIPaintingContext does not populate it from the graphics clip, so its value remains empty until assigned.

Gets the scale factors recorded by the most recent scale operation, or 1,1 after a reset.

C#
public SizeF ScaleFactor { get; protected set; }

Implements: IPaintingContext.ScaleFactor

Methods

Draws the outline of the ellipse inscribed in the specified rectangle.

C#
public abstract void DrawEllipse(RectangleF rectangle, Pen pen)
Parameters:rectangleRectangleF

The bounds of the ellipse.

penPen

The pen used to draw the outline.

Implements: IPaintingContext.DrawEllipse(RectangleF, Pen)

Draws an image into a destination rectangle using the specified opacity.

C#
public abstract void DrawImage(Image image, RectangleF rectangle, double opacity)
Parameters:imageImage

The image to draw.

rectangleRectangleF

The destination bounds.

opacitydouble

The opacity passed to the drawing backend.

Implements: IPaintingContext.DrawImage(Image, RectangleF, double)

Draws a straight line between two points.

C#
public abstract void DrawLine(PointF startPoint, PointF endPoint, Pen pen)
Parameters:startPointPointF

The line's starting point.

endPointPointF

The line's ending point.

penPen

The pen used to draw the line.

Implements: IPaintingContext.DrawLine(PointF, PointF, Pen)

Draws connected line segments through the supplied points.

C#
public abstract void DrawLines(PointF[] pointF, Pen pen)
Parameters:pointFPointF[]

The points that define the connected segments.

penPen

The pen used to draw the segments.

Implements: IPaintingContext.DrawLines(PointF[], Pen)

Draws connected line segments through the supplied points without closing the path.

C#
public abstract void DrawPath(PointF[] pointF, Pen pen)
Parameters:pointFPointF[]

The points that define the path.

penPen

The pen used to draw the path.

Implements: IPaintingContext.DrawPath(PointF[], Pen)

Draws a closed outline through the supplied points.

C#
public abstract void DrawPolygon(PointF[] pointF, Pen pen)
Parameters:pointFPointF[]

The points that define the polygon.

penPen

The pen used to draw the outline.

Implements: IPaintingContext.DrawPolygon(PointF[], Pen)

Draws the outline of the specified rectangle.

C#
public abstract void DrawRectangle(RectangleF rectangle, Pen pen)
Parameters:rectangleRectangleF

The rectangle to outline.

penPen

The pen used to draw the outline.

Implements: IPaintingContext.DrawRectangle(RectangleF, Pen)

Fills the ellipse inscribed in the specified rectangle.

C#
public abstract void FillEllipse(RectangleF rectanlge, Brush color)
Parameters:rectanlgeRectangleFcolorBrush

Implements: IPaintingContext.FillEllipse(RectangleF, Brush)

Fills a polygon defined by the supplied points.

C#
public abstract void FillPolygon(PointF[] pointF, Brush brush)
Parameters:pointFPointF[]

The points that define the polygon.

brushBrush

The brush used to fill the polygon.

Implements: IPaintingContext.FillPolygon(PointF[], Brush)

Fills the specified rectangle with a brush.

C#
public abstract void FillRectangle(RectangleF rectanlge, Brush color)
Parameters:rectanlgeRectangleFcolorBrush

Implements: IPaintingContext.FillRectangle(RectangleF, Brush)

Inverts the rendered pixels within the specified rectangle.

C#
public abstract void InvertRectangle(RectangleF rectangle)
Parameters:rectangleRectangleF

The bounds of the pixels to invert.

Implements: IPaintingContext.InvertRectangle(RectangleF)

Resets the drawing surface transformation and records a scale factor of 1,1.

C#
public void ResetTransformation()

Implements: IPaintingContext.ResetTransformation()

Restores the backend's drawing surface to its untransformed state.

C#
protected abstract void ResetTransformationOverride()

Applies a scale to the drawing surface and records the supplied factors in ScaleFactor.

C#
public void ScaleTransformation(float x, float y)
Parameters:xfloat

The horizontal scale factor.

yfloat

The vertical scale factor.

Implements: IPaintingContext.ScaleTransformation(float, float)

Applies the scale to the backend's drawing surface.

C#
protected abstract void ScaleTransformationOverride(float x, float y)
Parameters:xfloat

The horizontal scale factor.

yfloat

The vertical scale factor.