New to Telerik UI for WinFormsStart a free 30-day trial

Provides GDI+ graphics implementation for RadControls with optimized drawing operations and text rendering.

Definition

Namespace:Telerik.WinControls.Paint

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class RadGdiGraphics : IGraphics, IDisposable

Inheritance: objectRadGdiGraphics

Implements: IDisposableIGraphics

Constructors

Initializes a new instance of RadGdiGraphics class using GDI graphics context.

C#
public RadGdiGraphics(Graphics graphics)
Parameters:graphicsGraphics

Fields

C#
public static readonly int GdiMaximumDrawRectangleLimit
C#
public static readonly int GdiMinimumDrawRectangleLimit
C#
public static readonly int GdiStringLengthLimit

Properties

Gets the clipping rectangle; the rectangle which needs redrawing.

C#
public Rectangle ClipRectangle { get; set; }

Implements: IGraphics.ClipRectangle

Gets or sets current GDI+ graphics context.

C#
public Graphics Graphics { get; set; }
C#
public static Graphics MeasurementGraphics { get; }

Gets or sets the opacity level of the device context.

C#
public double Opacity { get; }

Implements: IGraphics.Opacity

Gets the current context device - graphics object.

C#
public object UnderlayGraphics { get; }

Implements: IGraphics.UnderlayGraphics

Methods

C#
protected ~RadGdiGraphics()

Changes the opacity level of the current device context.

C#
public void ChangeOpacity(double opacity)
Parameters:opacitydouble

Implements: IGraphics.ChangeOpacity(double)

Saves the current smothingMode, and changes the smoothingmode for the current device context.

C#
public virtual void ChangeSmoothingMode(SmoothingMode smoothingMode)
Parameters:smoothingModeSmoothingMode

Implements: IGraphics.ChangeSmoothingMode(SmoothingMode)

C#
protected bool CheckValidPath(GraphicsPath path)
Parameters:pathGraphicsPathReturns:

bool

C#
protected bool CheckValidRectangle(Rectangle rectangle)
Parameters:rectangleRectangleReturns:

bool

C#
protected bool CheckValidRectangle(RectangleF rectangle)
Parameters:rectangleRectangleFReturns:

bool

Creates a mask specified by color and bitmap.

C#
public Bitmap CreateBitmapMask(Color maskColor, Bitmap bitmap)
Parameters:maskColorColorbitmapBitmapReturns:

Bitmap

Implements: IGraphics.CreateBitmapMask(Color, Bitmap)

Disposes the object.

C#
public void Destroy()

Disposes the GDI+ graphics context.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Draws a bitmap image specified by image object and position from the left-upper corner of the current device context and specified opacity.

C#
public virtual void DrawBitmap(Image image, int x, int y, double opacity)
Parameters:imageImagexintyintopacitydouble

Implements: IGraphics.DrawBitmap(Image, int, int, double)

Draws a bitmap image specified by image object, position from the left-upper corner of the current device context, opacity and specified size.

C#
public virtual void DrawBitmap(Image image, int x, int y, int width, int height, double opacity)
Parameters:imageImagexintyintwidthintheightintopacitydouble

Implements: IGraphics.DrawBitmap(Image, int, int, int, int, double)

Draws a bitmap image specified by image object, position from the left-upper corner of the current device context and specified size.

C#
public virtual void DrawBitmap(Image image, int x, int y, int width, int height)
Parameters:imageImagexintyintwidthintheightint

Implements: IGraphics.DrawBitmap(Image, int, int, int, int)

Draws a bitmap image specified by image object and position from the left-upper corner of the current device context.

C#
public virtual void DrawBitmap(Image image, int x, int y)
Parameters:imageImagexintyint

Implements: IGraphics.DrawBitmap(Image, int, int)

Draws a blur shadow effect for the specified graphics path.

C#
public void DrawBlurShadow(GraphicsPath path, Rectangle r, float offset, Color color)
Parameters:pathGraphicsPath

The GraphicsPath for which to draw the shadow.

rRectangle

The bounding rectangle for the shadow effect.

offsetfloat

The offset distance of the shadow from the original path.

colorColor

The Color of the shadow.

Implements: IGraphics.DrawBlurShadow(GraphicsPath, Rectangle, float, Color)

Draws a border specified by rectangle structure, IBorderElement.

C#
public virtual void DrawBorder(RectangleF rectangle, IBorderElement borderElement)
Parameters:rectangleRectangleFborderElementIBorderElement

Implements: IGraphics.DrawBorder(RectangleF, IBorderElement)

C#
public void DrawCustomGradientPath(GraphicsPath path, GraphicsPath gradientPath, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:pathGraphicsPathgradientPathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]
C#
public void DrawCustomGradientPath(GraphicsPath path, GraphicsPath gradientPath, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:pathGraphicsPathgradientPathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Draws a custom gradient path specified by GraphicsPath, GraphicsPath for the gradient, color, gradient color array, penalignment and penwidth.

C#
public void DrawCustomGradientPath(GraphicsPath path, GraphicsPath gradientPath, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:pathGraphicsPathgradientPathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawCustomGradientPath(GraphicsPath, GraphicsPath, Color, Color[], PenAlignment, float)

Draws a custom gradient rectangle specified by rectangle structure, graphicsPath, color, color array for the gradient effect, penalignment and penwidth.

C#
public virtual void DrawCustomGradientRectangle(Rectangle rectangle, GraphicsPath path, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectanglepathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawCustomGradientRectangle(Rectangle, GraphicsPath, Color, Color[], PenAlignment, float)

Draws a custom gradient rectangle specified by rectangle structure, graphicsPath, color, color array for the gradient effect, penalignment, penwidth and DashStyle.

C#
public virtual void DrawCustomGradientRectangle(RectangleF rectangle, GraphicsPath path, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:rectangleRectangleFpathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle, float[])

Draws a custom gradient rectangle specified by rectangle structure, graphicsPath, color, color array for the gradient effect, penalignment, penwidth and DashStyle.

C#
public virtual void DrawCustomGradientRectangle(RectangleF rectangle, GraphicsPath path, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:rectangleRectangleFpathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Implements: IGraphics.DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle)

Draws a custom gradient rectangle specified by rectangle structure, graphicsPath, color, color array for the gradient effect, penalignment and penwidth.

C#
public virtual void DrawCustomGradientRectangle(RectangleF rectangle, GraphicsPath path, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectangleFpathGraphicsPathcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float)

Draws an ellipse defined by a bounding rectangle and color.

C#
public virtual void DrawEllipse(Rectangle rectangle, Color color)
Parameters:rectangleRectanglecolorColor

Implements: IGraphics.DrawEllipse(Rectangle, Color)

Draws the specified Image object with the specified Point, Image and disable flag.

C#
public virtual void DrawImage(Point point, Image image, bool enabled)
Parameters:pointPointimageImageenabledbool

Implements: IGraphics.DrawImage(Point, Image, bool)

Draws the specified Image object with the specified Rectangle, Image, ContentAlignment and disable flag.

C#
public virtual void DrawImage(Rectangle rectangle, Image image, ContentAlignment alignment, bool enabled)
Parameters:rectangleRectangleimageImagealignmentContentAlignmentenabledbool

Implements: IGraphics.DrawImage(Rectangle, Image, ContentAlignment, bool)

C#
public virtual void DrawLine(Color color, DashStyle dashStyle, float[] dashPattern, int x1, int y1, int x2, int y2)
Parameters:colorColordashStyleDashStyledashPatternfloat[]x1inty1intx2inty2int

Draws a line specified by color, DashStyle, initial x point, initial y point, final x final y point and width.

C#
public virtual void DrawLine(Color color, DashStyle dashStyle, int x1, int y1, int x2, int y2, float width)
Parameters:colorColordashStyleDashStylex1inty1intx2inty2intwidthfloat

Implements: IGraphics.DrawLine(Color, DashStyle, int, int, int, int, float)

Draws a line specified by color, DashStyle, initial x point, initial y point, final x and final y point.

C#
public virtual void DrawLine(Color color, DashStyle dashStyle, int x1, int y1, int x2, int y2)
Parameters:colorColordashStyleDashStylex1inty1intx2inty2int

Implements: IGraphics.DrawLine(Color, DashStyle, int, int, int, int)

Draws a line specified by color, initial x point, initial y point, final x, final y point and width

C#
public virtual void DrawLine(Color color, float x1, float y1, float x2, float y2, float width)
Parameters:colorColorx1floaty1floatx2floaty2floatwidthfloat

Implements: IGraphics.DrawLine(Color, float, float, float, float, float)

Draws a line specified by color, initial x point, initial y point, final x and final y point.

C#
public virtual void DrawLine(Color color, float x1, float y1, float x2, float y2)
Parameters:colorColorx1floaty1floatx2floaty2float

Implements: IGraphics.DrawLine(Color, float, float, float, float)

Draws a line specified by color, initial x point, initial y point, final x and final y point.

C#
public virtual void DrawLine(Color color, int x1, int y1, int x2, int y2)
Parameters:colorColorx1inty1intx2inty2int

Implements: IGraphics.DrawLine(Color, int, int, int, int)

Draws a linear gradient path specified by GraphicsPath, bounding Rectangle, color gradient array, penalignment, penwidth, angle and DashStyle.

C#
public void DrawLinearGradientPath(GraphicsPath path, RectangleF bounds, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle, DashStyle dashStyle, float[] dashPattern)
Parameters:pathGraphicsPathboundsRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float, DashStyle, float[])

Draws a linear gradient path specified by GraphicsPath, bounding Rectangle, color gradient array, penalignment, penwidth, angle and DashStyle.

C#
public void DrawLinearGradientPath(GraphicsPath path, RectangleF bounds, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle, DashStyle dashStyle)
Parameters:pathGraphicsPathboundsRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloatdashStyleDashStyle

Implements: IGraphics.DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float, DashStyle)

Draws a linear gradient path specified by GraphicsPath, bounding Rectangle, color gradient array, penalignment, penwidth and angle.

C#
public void DrawLinearGradientPath(GraphicsPath path, RectangleF bounds, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle)
Parameters:pathGraphicsPathboundsRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloat

Implements: IGraphics.DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float)

Draws a linear gradient rectangle specified by rectangle structure, color array, penalignment, penWidth, angle and DashStyle.

C#
public virtual void DrawLinearGradientRectangle(RectangleF rectangle, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle, DashStyle dashStyle, float[] dashPattern)
Parameters:rectangleRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float, DashStyle, float[])

Draws a linear gradient rectangle specified by rectangle structure, color array, penalignment, penWidth, angle and DashStyle.

C#
public virtual void DrawLinearGradientRectangle(RectangleF rectangle, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle, DashStyle dashStyle)
Parameters:rectangleRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloatdashStyleDashStyle

Implements: IGraphics.DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float, DashStyle)

Draws a linear gradient rectangle specified by rectangle structure, color array, penalignment, penWidth and angle.

C#
public virtual void DrawLinearGradientRectangle(RectangleF rectangle, Color[] gradientColors, PenAlignment penAlignment, float penWidth, float angle)
Parameters:rectangleRectangleFgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatanglefloat

Implements: IGraphics.DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float)

Draws a path specified by GraphicsPath, color, pen alignment, pen width and DashStyle.

C#
public virtual void DrawPath(GraphicsPath path, Color color, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:pathGraphicsPathcolorColorpenAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawPath(GraphicsPath, Color, PenAlignment, float, DashStyle, float[])

Draws a path specified by GraphicsPath, color, pen alignment, pen width and DashStyle.

C#
public virtual void DrawPath(GraphicsPath path, Color color, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:pathGraphicsPathcolorColorpenAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Implements: IGraphics.DrawPath(GraphicsPath, Color, PenAlignment, float, DashStyle)

Draws a path specified by GraphicsPath, color, pen alignment and pen width.

C#
public virtual void DrawPath(GraphicsPath path, Color color, PenAlignment penAlignment, float penWidth)
Parameters:pathGraphicsPathcolorColorpenAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawPath(GraphicsPath, Color, PenAlignment, float)

Draws a redial gradient path specified by Graphics path, bounding rectangle, color, color gradient array, pen alignment and pen width.

C#
public void DrawRadialGradientPath(GraphicsPath path, Rectangle bounds, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:pathGraphicsPathboundsRectanglecolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float, DashStyle, float[])

Draws a redial gradient path specified by Graphics path, bounding rectangle, color, color gradient array, pen alignment and pen width.

C#
public void DrawRadialGradientPath(GraphicsPath path, Rectangle bounds, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:pathGraphicsPathboundsRectanglecolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Implements: IGraphics.DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float, DashStyle)

Draws a redial gradient path specified by Graphicspath, bounding rectangle, color, color gradient array, penalignment and penwidth.

C#
public void DrawRadialGradientPath(GraphicsPath path, Rectangle bounds, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:pathGraphicsPathboundsRectanglecolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float)

Draws a radial gradient rectangle specified by rectangle structure, color, color array for gradient effect, penalignment and penWidth.

C#
public virtual void DrawRadialGradientRectangle(Rectangle rectangle, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectanglecolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawRadialGradientRectangle(Rectangle, Color, Color[], PenAlignment, float)

Draws a radial gradient rectangle specified by rectangle structure, color, color array for gradient effect, penalignment, penWidth and DashStyle.

C#
public virtual void DrawRadialGradientRectangle(RectangleF rectangle, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:rectangleRectangleFcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float, DashStyle, float[])

Draws a radial gradient rectangle specified by rectangle structure, color, color array for gradient effect, penalignment, penWidth and DashStyle.

C#
public virtual void DrawRadialGradientRectangle(RectangleF rectangle, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:rectangleRectangleFcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Implements: IGraphics.DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float, DashStyle)

Draws a radial gradient rectangle specified by rectangle structure, color, color array for gradient effect, penalignment and penWidth.

C#
public virtual void DrawRadialGradientRectangle(RectangleF rectangle, Color color, Color[] gradientColors, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectangleFcolorColorgradientColorsColor[]penAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float)

Draws a rectangle specified by rectangle structure, color, PenAlignment and pen width.

C#
public virtual void DrawRectangle(Rectangle rectangle, Color color, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectanglecolorColorpenAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawRectangle(Rectangle, Color, PenAlignment, float)

Draws a rectangle specified by a rectangle structure and a color.

C#
public virtual void DrawRectangle(Rectangle rectangle, Color color)
Parameters:rectangleRectanglecolorColor

Implements: IGraphics.DrawRectangle(Rectangle, Color)

Draws a rectangle specified by rectangle structure, color, PenAlignment, pen width and DashStyle.

C#
public virtual void DrawRectangle(RectangleF rectangle, Color color, PenAlignment penAlignment, float penWidth, DashStyle dashStyle, float[] dashPattern)
Parameters:rectangleRectangleFcolorColorpenAlignmentPenAlignmentpenWidthfloatdashStyleDashStyledashPatternfloat[]

Implements: IGraphics.DrawRectangle(RectangleF, Color, PenAlignment, float, DashStyle, float[])

Draws a rectangle specified by rectangle structure, color, PenAlignment, pen width and DashStyle.

C#
public virtual void DrawRectangle(RectangleF rectangle, Color color, PenAlignment penAlignment, float penWidth, DashStyle dashStyle)
Parameters:rectangleRectangleFcolorColorpenAlignmentPenAlignmentpenWidthfloatdashStyleDashStyle

Implements: IGraphics.DrawRectangle(RectangleF, Color, PenAlignment, float, DashStyle)

Draws a rectangle specified by rectangle structure, color, PenAlignment and pen width.

C#
public virtual void DrawRectangle(RectangleF rectangle, Color color, PenAlignment penAlignment, float penWidth)
Parameters:rectangleRectangleFcolorColorpenAlignmentPenAlignmentpenWidthfloat

Implements: IGraphics.DrawRectangle(RectangleF, Color, PenAlignment, float)

Draws a round rectangle specified by Rectangle structure, color, float borderWidth, and radius in pixels.

C#
public virtual void DrawRoundRect(Rectangle rectangle, Color color, float borderWidth, int radius)
Parameters:rectangleRectanglecolorColorborderWidthfloatradiusint

Implements: IGraphics.DrawRoundRect(Rectangle, Color, float, int)

C#
public virtual void DrawString(string s, Rectangle rectangle, Font font, Color foreColor, StringFormat stringFormat, Orientation orientation, bool flipText, CharacterRange[] highlightRanges, Color highlightColor)
Parameters:sstringrectangleRectanglefontFontforeColorColorstringFormatStringFormatorientationOrientationflipTextboolhighlightRangesCharacterRange[]highlightColorColor

Draws the specified text string with specified Rectangle, Font, Color, ContentAlignment, StringFormat and Orientation.

C#
public virtual void DrawString(string s, Rectangle rectangle, Font font, Color foreColor, StringFormat stringFormat, Orientation orientation, bool flipText)
Parameters:sstringrectangleRectanglefontFontforeColorColorstringFormatStringFormatorientationOrientationflipTextbool

Implements: IGraphics.DrawString(string, Rectangle, Font, Color, StringFormat, Orientation, bool)

C#
public virtual void DrawString(string s, Rectangle rectangle, Font font, Color foreColor, StringFormat stringFormat, ShadowSettings shadow, TextRenderingHint textRendering, Orientation orientation, bool flipText, CharacterRange[] highlightRanges, Color highlightColor)
Parameters:sstringrectangleRectanglefontFontforeColorColorstringFormatStringFormatshadowShadowSettingstextRenderingTextRenderingHintorientationOrientationflipTextboolhighlightRangesCharacterRange[]highlightColorColor
C#
public virtual void DrawString(string s, Rectangle rectangle, Font font, Color foreColor, StringFormat stringFormat, ShadowSettings shadow, TextRenderingHint textRendering, Orientation orientation, bool flipText)
Parameters:sstringrectangleRectanglefontFontforeColorColorstringFormatStringFormatshadowShadowSettingstextRenderingTextRenderingHintorientationOrientationflipTextbool
C#
public virtual void DrawString(string s, RectangleF rectangle, Font font, Color foreColor, StringFormat stringFormat, Orientation orientation, bool flipText, CharacterRange[] highlightRanges, Color highlightColor)
Parameters:sstringrectangleRectangleFfontFontforeColorColorstringFormatStringFormatorientationOrientationflipTextboolhighlightRangesCharacterRange[]highlightColorColor
C#
public virtual void DrawString(string s, RectangleF rectangle, Font font, Color foreColor, StringFormat stringFormat, Orientation orientation, bool flipText)
Parameters:sstringrectangleRectangleFfontFontforeColorColorstringFormatStringFormatorientationOrientationflipTextbool

Implements: IGraphics.DrawString(string, RectangleF, Font, Color, StringFormat, Orientation, bool)

C#
public virtual void DrawString(string s, RectangleF rectangle, Font font, Color foreColor, StringFormat stringFormat, ShadowSettings shadow, TextRenderingHint textRendering, Orientation orientation, bool flipText, CharacterRange[] highlightRanges, Color highlightColor)
Parameters:sstringrectangleRectangleFfontFontforeColorColorstringFormatStringFormatshadowShadowSettingstextRenderingTextRenderingHintorientationOrientationflipTextboolhighlightRangesCharacterRange[]highlightColorColor
C#
public virtual void DrawString(string s, RectangleF rectangle, Font font, Color foreColor, StringFormat stringFormat, ShadowSettings shadow, TextRenderingHint textRendering, Orientation orientation, bool flipText)
Parameters:sstringrectangleRectangleFfontFontforeColorColorstringFormatStringFormatshadowShadowSettingstextRenderingTextRenderingHintorientationOrientationflipTextbool
C#
public virtual void DrawString(TextParams textParams, SizeF measuredSize)
Parameters:textParamsTextParamsmeasuredSizeSizeF

Implements: IGraphics.DrawString(TextParams, SizeF)

Updates the clipping region of the current Graphics object to exclude the area specified by a Rectangle structure.

C#
public virtual void ExcludeClip(Rectangle rectangle)
Parameters:rectangleRectangle

Implements: IGraphics.ExcludeClip(Rectangle)

Fills the gel gradient rectangle specified by rectangle structure, color, color, and gradientPercentage.

C#
public virtual void FillGellRectangle(Rectangle rectangle, Color[] colorStops, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectanglecolorStopsColor[]gradientPercentagefloatgradientPercentage2float

Implements: IGraphics.FillGellRectangle(Rectangle, Color[], float, float)

Fills the glass gradient rectangle specified by rectangle structure, color, color, color, color, and gradient percentage.

C#
public virtual void FillGlassRectangle(Rectangle rectangle, Color color1, Color color2, Color color3, Color color4, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectanglecolor1Colorcolor2Colorcolor3Colorcolor4ColorgradientPercentagefloatgradientPercentage2float

Implements: IGraphics.FillGlassRectangle(Rectangle, Color, Color, Color, Color, float, float)

C#
public virtual void FillGlassRectangleNew(Rectangle rectangle, Color color1, Color color2, Color color3, Color color4, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectanglecolor1Colorcolor2Colorcolor3Colorcolor4ColorgradientPercentagefloatgradientPercentage2float
C#
public virtual void FillGradientPath(GraphicsPath path, RectangleF rectangle, Color[] colorStops, float[] colorOffsets, GradientStyles style, float angle, float gradientPercentage, float gradientPercentage2)
Parameters:pathGraphicsPathrectangleRectangleFcolorStopsColor[]colorOffsetsfloat[]styleGradientStylesanglefloatgradientPercentagefloatgradientPercentage2float

Fills gradient rectangle specified by rectangle structure, color, color, color, color, GradientStyles, and angle.

C#
public virtual void FillGradientRectangle(Rectangle rectangle, Color color1, Color color2, Color color3, Color color4, GradientStyles style, float angle)
Parameters:rectangleRectanglecolor1Colorcolor2Colorcolor3Colorcolor4ColorstyleGradientStylesanglefloat

Implements: IGraphics.FillGradientRectangle(Rectangle, Color, Color, Color, Color, GradientStyles, float)

Fills the gradient rectangle specified by rectangle structure, color gradient array, float offset array, GradientStyles, angle, gradientPercentage, and gradientPercentage2.

C#
public virtual void FillGradientRectangle(Rectangle rectangle, Color color1, Color color2, float angle)
Parameters:rectangleRectanglecolor1Colorcolor2Coloranglefloat

Implements: IGraphics.FillGradientRectangle(Rectangle, Color, Color, float)

Fills the gradient rectangle specified by rectangle structure, color gradient array, float offset array, GradientStyles, angle, gradientPercentage, and gradientPercentage2.

C#
public virtual void FillGradientRectangle(Rectangle rectangle, Color[] colorStops, float[] colorOffsets, GradientStyles style, float angle, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectanglecolorStopsColor[]colorOffsetsfloat[]styleGradientStylesanglefloatgradientPercentagefloatgradientPercentage2float

Implements: IGraphics.FillGradientRectangle(Rectangle, Color[], float[], GradientStyles, float, float, float)

C#
public virtual void FillGradientRectangle(RectangleF rectangle, Color[] colorStops, float[] colorOffsets, GradientStyles style, float angle, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectangleFcolorStopsColor[]colorOffsetsfloat[]styleGradientStylesanglefloatgradientPercentagefloatgradientPercentage2float

Implements: IGraphics.FillGradientRectangle(RectangleF, Color[], float[], GradientStyles, float, float, float)

Fills the office glass gradient rectangle specified by rectangle structure, color, color, color, color, and gradientPercentage and gradientPercentage2.

C#
public void FillOfficeGlassRectangle(Rectangle rectangle, Color color1, Color color2, Color color3, Color color4, float gradientPercentage, float gradientPercentage2, bool drawEllipse)
Parameters:rectangleRectanglecolor1Colorcolor2Colorcolor3Colorcolor4ColorgradientPercentagefloatgradientPercentage2floatdrawEllipsebool

Implements: IGraphics.FillOfficeGlassRectangle(Rectangle, Color, Color, Color, Color, float, float, bool)

Fills the specified graphics path with a solid color.

C#
public void FillPath(Color color, GraphicsPath path)
Parameters:colorColor

The Color to use for filling the path.

pathGraphicsPath

The GraphicsPath to fill.

Implements: IGraphics.FillPath(Color, GraphicsPath)

Fills the specified graphics path with a gradient using the provided color stops and offsets.

C#
public void FillPath(Color[] colorStops, float[] colorOffsets, float angle, float gradientPercentage, float gradientPercentage2, Rectangle rectangle, GraphicsPath path)
Parameters:colorStopsColor[]

An array of colors that define the gradient.

colorOffsetsfloat[]

An array of float values that specify the positions of the color stops along the gradient.

anglefloat

The angle of the gradient direction in degrees.

gradientPercentagefloat

The first gradient percentage value.

gradientPercentage2float

The second gradient percentage value.

rectangleRectangle

The bounding rectangle for the gradient.

pathGraphicsPath

The GraphicsPath to fill with the gradient.

Implements: IGraphics.FillPath(Color[], float[], float, float, float, Rectangle, GraphicsPath)

Fills the interior of a polygon defined by brush and an array of points specified by Point structures.

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

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

Fills the interior of a polygon defined by an array of points specified by Point structures and color.

C#
public void FillPolygon(Color color, Point[] points)
Parameters:colorColorpointsPoint[]

Implements: IGraphics.FillPolygon(Color, Point[])

Fills the interior of a polygon defined by color and an array of points specified by Point structures.

C#
public void FillPolygon(Color color, PointF[] points)
Parameters:colorColorpointsPointF[]

Implements: IGraphics.FillPolygon(Color, PointF[])

Fills the interior of a rectangle specified by the borderRectangle and using for color the second argument.

C#
public virtual void FillRectangle(Rectangle rectangle, Color color)
Parameters:rectangleRectanglecolorColor

Implements: IGraphics.FillRectangle(Rectangle, Color)

C#
public virtual void FillRectangle(RectangleF rectangle, Color color)
Parameters:rectangleRectangleFcolorColor

Implements: IGraphics.FillRectangle(RectangleF, Color)

Fills a rectangle using the image as texture.

C#
public void FillTextureRectangle(Rectangle rectangle, Image texture, WrapMode wrapMode)
Parameters:rectangleRectangle

The rectangle to fill.

textureImage

The image to use as a texture.

wrapModeWrapMode

Defines the way the image is populated in the rectangle

Implements: IGraphics.FillTextureRectangle(Rectangle, Image, WrapMode)

Fills a rectangle using the image as texture.

C#
public void FillTextureRectangle(Rectangle rectangle, Image texture)
Parameters:rectangleRectangle

The rectangle to fill.

textureImage

The image to use as a texture.

Implements: IGraphics.FillTextureRectangle(Rectangle, Image)

Fills a rectangle using the image as texture.

C#
public void FillTextureRectangle(RectangleF rectangle, Image texture, WrapMode wrapMode)
Parameters:rectangleRectangleF

The rectangle to fill.

textureImage

The image to use as a texture.

wrapModeWrapMode

Defines the way the image is populated in the rectangle

Implements: IGraphics.FillTextureRectangle(RectangleF, Image, WrapMode)

Fills a rectangle using the image as texture.

C#
public void FillTextureRectangle(RectangleF rectangle, Image texture)
Parameters:rectangleRectangleF

The rectangle to fill.

textureImage

The image to use as a texture.

Implements: IGraphics.FillTextureRectangle(RectangleF, Image)

Fills the vista gradient rectangle specified by rectangle structure, color, color, color, color, gradient percentage, and gradientPercentage2.

C#
public void FillVistaRectangle(Rectangle rectangle, Color color1, Color color2, Color color3, Color color4, float gradientPercentage, float gradientPercentage2)
Parameters:rectangleRectanglecolor1Colorcolor2Colorcolor3Colorcolor4ColorgradientPercentagefloatgradientPercentage2float

Implements: IGraphics.FillVistaRectangle(Rectangle, Color, Color, Color, Color, float, float)

C#
public static ImageAttributes GetOpacityAttributes(float opacity)
Parameters:opacityfloatReturns:

ImageAttributes

C#
public GraphicsPath GetRoundedRect(RectangleF baseRect, float radius)
Parameters:baseRectRectangleFradiusfloatReturns:

GraphicsPath

C#
public static FontTextMetrics GetTextMetric(Font font)
Parameters:fontFontReturns:

FontTextMetrics

C#
public Image ImageFromText(string strText, Font fnt, Color clrFore, Color clrBack)
Parameters:strTextstringfntFontclrForeColorclrBackColorReturns:

Image

C#
public SizeF MeasureString(string text, Font font, int availableWidth, StringFormat stringFormat)
Parameters:textstringfontFontavailableWidthintstringFormatStringFormatReturns:

SizeF

C#
public SizeF MeasureString(string text, Font font, StringFormat stringFormat)
Parameters:textstringfontFontstringFormatStringFormatReturns:

SizeF

Implements: IGraphics.MeasureString(string, Font, StringFormat)

C#
public static RectangleF NormalizeRect(RectangleF actual)
Parameters:actualRectangleFReturns:

RectangleF

C#
public GraphicsPath PopCurrentClippingPath()
Returns:

GraphicsPath

Implements: IGraphics.PopCurrentClippingPath()

C#
public void PushCurrentClippingPath(GraphicsPath path)
Parameters:pathGraphicsPath

Implements: IGraphics.PushCurrentClippingPath(GraphicsPath)

Resets the world transformation matrix of this Graphics to the identity matrix.

C#
public void ResetTransform()

Implements: IGraphics.ResetTransform()

Restores the opacity of the current device context to the previous value.

C#
public void RestoreOpacity()

Implements: IGraphics.RestoreOpacity()

Restores the smoothing mode to the previous value.

C#
public virtual void RestoreSmoothingMode()

Implements: IGraphics.RestoreSmoothingMode()

Restores the graphics state to a previously saved state.

C#
public void RestoreState(object state)
Parameters:stateobject

The state object returned by a previous call to SaveState().

Implements: IGraphics.RestoreState(object)

Rotates the local geometric transformation by the specified angle. This method prepends the rotation to the transformation.

C#
public void RotateTransform(float angleInDegrees)
Parameters:angleInDegreesfloat

Implements: IGraphics.RotateTransform(float)

Saves the current graphics state and returns a state object.

C#
public object SaveState()
Returns:

object

An object representing the saved graphics state, which can be passed to RestoreState(object) to restore the graphics context.

Implements: IGraphics.SaveState()

Scales the world transformation matrix by the specified amount.

C#
public void ScaleTransform(SizeF scale)
Parameters:scaleSizeF

Implements: IGraphics.ScaleTransform(SizeF)

Translates the local geometric transformation of this TextureBrush object by the specified dimensions. This method prepends the translation to the transformation.

C#
public void TranslateTransform(float offsetX, float offsetY)
Parameters:offsetXfloatoffsetYfloat

Implements: IGraphics.TranslateTransform(float, float)

Translates the local geometric transformation of this TextureBrush object by the specified dimensions. This method prepends the translation to the transformation.

C#
public void TranslateTransform(int offsetX, int offsetY)
Parameters:offsetXintoffsetYint

Implements: IGraphics.TranslateTransform(int, int)

In this article
DefinitionConstructorsRadGdiGraphics(Graphics)FieldsGdiMaximumDrawRectangleLimitGdiMinimumDrawRectangleLimitGdiStringLengthLimitPropertiesClipRectangleGraphicsMeasurementGraphicsOpacityUnderlayGraphicsMethods~RadGdiGraphics()ChangeOpacity(double)ChangeSmoothingMode(SmoothingMode)CheckValidPath(GraphicsPath)CheckValidRectangle(Rectangle)CheckValidRectangle(RectangleF)CreateBitmapMask(Color, Bitmap)Destroy()Dispose()DrawBitmap(Image, int, int, double)DrawBitmap(Image, int, int, int, int, double)DrawBitmap(Image, int, int, int, int)DrawBitmap(Image, int, int)DrawBlurShadow(GraphicsPath, Rectangle, float, Color)DrawBorder(RectangleF, IBorderElement)DrawCustomGradientPath(GraphicsPath, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle, float[])DrawCustomGradientPath(GraphicsPath, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle)DrawCustomGradientPath(GraphicsPath, GraphicsPath, Color, Color[], PenAlignment, float)DrawCustomGradientRectangle(Rectangle, GraphicsPath, Color, Color[], PenAlignment, float)DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle, float[])DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float, DashStyle)DrawCustomGradientRectangle(RectangleF, GraphicsPath, Color, Color[], PenAlignment, float)DrawEllipse(Rectangle, Color)DrawImage(Point, Image, bool)DrawImage(Rectangle, Image, ContentAlignment, bool)DrawLine(Color, DashStyle, float[], int, int, int, int)DrawLine(Color, DashStyle, int, int, int, int, float)DrawLine(Color, DashStyle, int, int, int, int)DrawLine(Color, float, float, float, float, float)DrawLine(Color, float, float, float, float)DrawLine(Color, int, int, int, int)DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float, DashStyle, float[])DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float, DashStyle)DrawLinearGradientPath(GraphicsPath, RectangleF, Color[], PenAlignment, float, float)DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float, DashStyle, float[])DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float, DashStyle)DrawLinearGradientRectangle(RectangleF, Color[], PenAlignment, float, float)DrawPath(GraphicsPath, Color, PenAlignment, float, DashStyle, float[])DrawPath(GraphicsPath, Color, PenAlignment, float, DashStyle)DrawPath(GraphicsPath, Color, PenAlignment, float)DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float, DashStyle, float[])DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float, DashStyle)DrawRadialGradientPath(GraphicsPath, Rectangle, Color, Color[], PenAlignment, float)DrawRadialGradientRectangle(Rectangle, Color, Color[], PenAlignment, float)DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float, DashStyle, float[])DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float, DashStyle)DrawRadialGradientRectangle(RectangleF, Color, Color[], PenAlignment, float)DrawRectangle(Rectangle, Color, PenAlignment, float)DrawRectangle(Rectangle, Color)DrawRectangle(RectangleF, Color, PenAlignment, float, DashStyle, float[])DrawRectangle(RectangleF, Color, PenAlignment, float, DashStyle)DrawRectangle(RectangleF, Color, PenAlignment, float)DrawRoundRect(Rectangle, Color, float, int)DrawString(string, Rectangle, Font, Color, StringFormat, Orientation, bool, CharacterRange[], Color)DrawString(string, Rectangle, Font, Color, StringFormat, Orientation, bool)DrawString(string, Rectangle, Font, Color, StringFormat, ShadowSettings, TextRenderingHint, Orientation, bool, CharacterRange[], Color)DrawString(string, Rectangle, Font, Color, StringFormat, ShadowSettings, TextRenderingHint, Orientation, bool)DrawString(string, RectangleF, Font, Color, StringFormat, Orientation, bool, CharacterRange[], Color)DrawString(string, RectangleF, Font, Color, StringFormat, Orientation, bool)DrawString(string, RectangleF, Font, Color, StringFormat, ShadowSettings, TextRenderingHint, Orientation, bool, CharacterRange[], Color)DrawString(string, RectangleF, Font, Color, StringFormat, ShadowSettings, TextRenderingHint, Orientation, bool)DrawString(TextParams, SizeF)ExcludeClip(Rectangle)FillGellRectangle(Rectangle, Color[], float, float)FillGlassRectangle(Rectangle, Color, Color, Color, Color, float, float)FillGlassRectangleNew(Rectangle, Color, Color, Color, Color, float, float)FillGradientPath(GraphicsPath, RectangleF, Color[], float[], GradientStyles, float, float, float)FillGradientRectangle(Rectangle, Color, Color, Color, Color, GradientStyles, float)FillGradientRectangle(Rectangle, Color, Color, float)FillGradientRectangle(Rectangle, Color[], float[], GradientStyles, float, float, float)FillGradientRectangle(RectangleF, Color[], float[], GradientStyles, float, float, float)FillOfficeGlassRectangle(Rectangle, Color, Color, Color, Color, float, float, bool)FillPath(Color, GraphicsPath)FillPath(Color[], float[], float, float, float, Rectangle, GraphicsPath)FillPolygon(Brush, PointF[])FillPolygon(Color, Point[])FillPolygon(Color, PointF[])FillRectangle(Rectangle, Color)FillRectangle(RectangleF, Color)FillTextureRectangle(Rectangle, Image, WrapMode)FillTextureRectangle(Rectangle, Image)FillTextureRectangle(RectangleF, Image, WrapMode)FillTextureRectangle(RectangleF, Image)FillVistaRectangle(Rectangle, Color, Color, Color, Color, float, float)GetOpacityAttributes(float)GetRoundedRect(RectangleF, float)GetTextMetric(Font)ImageFromText(string, Font, Color, Color)MeasureString(string, Font, int, StringFormat)MeasureString(string, Font, StringFormat)NormalizeRect(RectangleF)PopCurrentClippingPath()PushCurrentClippingPath(GraphicsPath)ResetTransform()RestoreOpacity()RestoreSmoothingMode()RestoreState(object)RotateTransform(float)SaveState()ScaleTransform(SizeF)TranslateTransform(float, float)TranslateTransform(int, int)
Not finding the help you need?
Contact Support