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

Implements Spreadsheet painting operations with a GDI+ Graphics surface. This implementation does not populate ClipBounds from the graphics clip.

Definition

Namespace:Telerik.WinControls.Spreadsheet.UI

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public class GDIPaintingContext : PaintingContext, IPaintingContext

Inheritance: objectPaintingContextGDIPaintingContext

Implements: IPaintingContext

Inherited Members PaintingContext.ScaleTransformation(float, float)PaintingContext.ResetTransformation()PaintingContext.ScaleFactorPaintingContext.ClipBounds

Constructors

Creates a painting context for the specified graphics surface.

C#
public GDIPaintingContext(Graphics graphics)
Parameters:graphicsGraphics

The graphics surface used for drawing.

Properties

Gets or sets the graphics surface used by this context. Assigning a non-null surface also applies the Spreadsheet text-rendering hint.

C#
protected Graphics Graphics { get; set; }

Methods

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

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

The bounds of the ellipse.

penPen

The pen used to draw the outline.

Overrides: PaintingContext.DrawEllipse(RectangleF, Pen)

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

C#
public override 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.

Overrides: PaintingContext.DrawImage(Image, RectangleF, double)

When opacity is less than 1, this method uses GDI+ image attributes to apply it. Otherwise, it draws through the standard opaque image overload.

Draws a straight line between two points.

C#
public override 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.

Overrides: PaintingContext.DrawLine(PointF, PointF, Pen)

A custom dash style changes the graphics surface's SmoothingMode to HighQuality; the previous mode is not restored.

Draws connected line segments through the supplied points.

C#
public override void DrawLines(PointF[] points, Pen pen)
Parameters:pointsPointF[]penPen

The pen used to draw the segments.

Overrides: PaintingContext.DrawLines(PointF[], Pen)

A custom dash style changes the graphics surface's SmoothingMode to HighQuality; the previous mode is not restored.

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

C#
public override void DrawPath(PointF[] points, Pen pen)
Parameters:pointsPointF[]penPen

The pen used to draw the path.

Overrides: PaintingContext.DrawPath(PointF[], Pen)

Draws a closed outline through the supplied points.

C#
public override void DrawPolygon(PointF[] points, Pen pen)
Parameters:pointsPointF[]penPen

The pen used to draw the outline.

Overrides: PaintingContext.DrawPolygon(PointF[], Pen)

Draws the outline of the specified rectangle.

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

The rectangle to outline.

penPen

The pen used to draw the outline.

Overrides: PaintingContext.DrawRectangle(RectangleF, Pen)

Fills the ellipse inscribed in the specified rectangle.

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

Overrides: PaintingContext.FillEllipse(RectangleF, Brush)

Fills a polygon defined by the supplied points.

C#
public override void FillPolygon(PointF[] points, Brush brush)
Parameters:pointsPointF[]brushBrush

The brush used to fill the polygon.

Overrides: PaintingContext.FillPolygon(PointF[], Brush)

Fills the specified rectangle with a brush.

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

Overrides: PaintingContext.FillRectangle(RectangleF, Brush)

Inverts the rendered pixels within the specified rectangle.

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

The bounds of the pixels to invert.

Overrides: PaintingContext.InvertRectangle(RectangleF)

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

C#
protected override void ResetTransformationOverride()

Overrides: PaintingContext.ResetTransformationOverride()

Applies the scale to the backend's drawing surface.

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

The horizontal scale factor.

yfloat

The vertical scale factor.

Overrides: PaintingContext.ScaleTransformationOverride(float, float)