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

Provides shared clip-bound and scale state while leaving drawing operations to derived contexts.

Definition

Namespace:Telerik.WinControls.UI.Diagrams

Assembly:Telerik.WinControls.RadDiagram.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 reported by this context. The base class stores this value but does not apply clipping.

C#
public RectangleF ClipBounds { get; set; }

Implements: IPaintingContext.ClipBounds

Gets the most recent scale factors supplied to ScaleTransformation(float, float).

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

Implements: IPaintingContext.ScaleFactor

Methods

Outlines an ellipse inscribed in the specified rectangle.

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

The rectangle that bounds the ellipse.

penPen

The pen used to draw the outline.

Implements: IPaintingContext.DrawEllipse(RectangleF, Pen)

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

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

The image to draw.

rectangleRectangleF

The destination rectangle.

opacitydouble

The opacity factor passed to the drawing implementation.

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

Draws a 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 between each adjacent pair of points.

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

The ordered points that define the segments.

penPen

The pen used to draw the segments.

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

Draws an open path through the supplied points.

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

The ordered points along the path.

penPen

The pen used to draw the path.

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

Outlines a closed polygon through the supplied points.

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

The polygon's vertices in order.

penPen

The pen used to draw the outline.

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

Outlines a rectangle with a pen.

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 an ellipse inscribed in the specified rectangle.

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

Implements: IPaintingContext.FillEllipse(RectangleF, Brush)

Fills the polygon bounded by the supplied points.

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

The polygon's vertices in order.

brushBrush

The brush used to fill the polygon.

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

Fills a rectangle with a brush.

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

Implements: IPaintingContext.FillRectangle(RectangleF, Brush)

Inverts the colors in the specified rectangle.

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

The rectangle whose colors are inverted.

Implements: IPaintingContext.InvertRectangle(RectangleF)

Resets ScaleFactor to (1, 1) and asks the derived context to reset its drawing transformation.

C#
public void ResetTransformation()

Implements: IPaintingContext.ResetTransformation()

Resets the derived drawing surface's transformation.

C#
protected abstract void ResetTransformationOverride()

Updates ScaleFactor and applies the scale through the derived context.

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 a scale to the derived drawing surface.

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

The horizontal scale factor.

yfloat

The vertical scale factor.