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

Surface

Class

Definition

Namespace:Telerik.WinControls.Drawing

Assembly:Telerik.WinControls.dll

Syntax:

C#
public abstract class Surface

Inheritance: objectSurface

Derived Classes: GdiSurface

Constructors

C#
public Surface()
C#
public Surface(object deviceContext)
Parameters:deviceContextobject

Properties

C#
public object DeviceContext { get; }
C#
protected abstract Graphics Graphics { get; }
C#
public float Opacity { get; set; }

Resources

Dictionary<string, object>

C#
public Dictionary<string, object> Resources { get; }

Methods

C#
public abstract void BeginDraw(params object[] resources)
Parameters:resourcesobject[]
C#
public virtual void BeginEffects(Size viewportSize)
Parameters:viewportSizeSize
C#
public virtual RadDisplacementMapEffect CreateDisplacementMapEffect()
Returns:

RadDisplacementMapEffect

C#
public virtual RadGaussianBlurEffect CreateGaussianBlurEffect()
Returns:

RadGaussianBlurEffect

C#
public abstract RadBrush CreateLinearGradientBrush(RectangleF rectangle, GradientStop[] colorStops, float angle)
Parameters:rectangleRectangleFcolorStopsGradientStop[]anglefloatReturns:

RadBrush

C#
public abstract RadBrush CreateLinearGradientBrush(RectangleF rectangle, GradientStop[] colorStops, RadLinearGradientMode mode)
Parameters:rectangleRectangleFcolorStopsGradientStop[]modeRadLinearGradientModeReturns:

RadBrush

C#
public virtual RadMorphologyEffect CreateMorphologyEffect()
Returns:

RadMorphologyEffect

C#
public abstract Path CreatePath()
Returns:

Path

C#
public abstract RadBrush CreateRadialBrush(PointF center, float xRadius, float yRadius, GradientStop[] colorStops)
Parameters:centerPointFxRadiusfloatyRadiusfloatcolorStopsGradientStop[]Returns:

RadBrush

C#
public abstract RoundedRectangle CreateRoundedRectangle(RectangleF rect, float radius)
Parameters:rectRectangleFradiusfloatReturns:

RoundedRectangle

C#
public abstract RadBrush CreateSolidBrush(Color color)
Parameters:colorColorReturns:

RadBrush

C#
public abstract void DrawBorder(IBorderElement element, Path path)
Parameters:elementIBorderElementpathPath
C#
public abstract void DrawBorder(IBorderElement element, RectangleF rect)
Parameters:elementIBorderElementrectRectangleF
C#
protected void DrawEllipse(RectangleF rectangle, RadBrush brush, float width)
Parameters:rectangleRectangleFbrushRadBrushwidthfloat
C#
public abstract void DrawImage(IImageElement element, RectangleF rect)
Parameters:elementIImageElementrectRectangleF
C#
public abstract void DrawImage(Image image, RectangleF rect)
Parameters:imageImagerectRectangleF
C#
public abstract void DrawLine(RadBrush brush, float x1, float y1, float x2, float y2)
Parameters:brushRadBrushx1floaty1floatx2floaty2float
C#
protected abstract void DrawPathCore(Path path, RadBrush brush, float width)
Parameters:pathPathbrushRadBrushwidthfloat
C#
public abstract void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2)
Parameters:brushRadBrushx1floaty1floatx2floaty2float
C#
protected void DrawRectangle(RectangleF rectangle, RadBrush brush, float width)
Parameters:rectangleRectangleFbrushRadBrushwidthfloat
C#
public abstract void DrawText(ITextElement element, RadBrush brush, RectangleF rect)
Parameters:elementITextElementbrushRadBrushrectRectangleF
C#
public abstract void DrawText(string text, Font font, RadBrush brush, RectangleF rect, TextFormat textFormat)
Parameters:textstringfontFontbrushRadBrushrectRectangleFtextFormatTextFormat
C#
public abstract void EndDraw()
C#
public virtual void EndEffects(EffectCollection effects)
Parameters:effectsEffectCollection
C#
protected void FillEllipse(RectangleF rectangle, RadBrush brush)
Parameters:rectangleRectangleFbrushRadBrush
C#
protected virtual void FillOfficeGlass(Path inputPath, Color color1, Color color2, Color color3, Color color4, float gradientPercentage, float gradientPercentage2, bool fillEllipse)
Parameters:inputPathPathcolor1Colorcolor2Colorcolor3Colorcolor4ColorgradientPercentagefloatgradientPercentage2floatfillEllipsebool
C#
protected virtual bool FillOfficeGlassBottomGlow(Graphics graphics, Color color3, Color color4, RectangleF originalRectangle, int topHeight, bool fillEllipse)
Parameters:graphicsGraphicscolor3Colorcolor4ColororiginalRectangleRectangleFtopHeightintfillEllipseboolReturns:

bool

C#
protected virtual void FillOfficeGlassMain(Color color3, RectangleF innerRectangle, bool fillEllipse)
Parameters:color3ColorinnerRectangleRectangleFfillEllipsebool
C#
protected virtual void FillOfficeGlassOuterBorder(RectangleF originalRectangle, Color color3, int borderThicness, bool fillEllipse)
Parameters:originalRectangleRectangleFcolor3ColorborderThicnessintfillEllipsebool
C#
protected virtual void FillOfficeGlassTopInnerBorder(RectangleF originalRectangle, Color color1, Color color4, int borderThicness, bool fillEllipse)
Parameters:originalRectangleRectangleFcolor1Colorcolor4ColorborderThicnessintfillEllipsebool
C#
protected virtual bool FillOfficeGlassTopInnerGlow(Graphics graphics, Color color2, Color color3, RectangleF originalRectangle, bool fillEllipse)
Parameters:graphicsGraphicscolor2Colorcolor3ColororiginalRectangleRectangleFfillEllipseboolReturns:

bool

C#
protected virtual void FillOfficeGlassTopLightGlow(Graphics graphics, Color color1, Color color2, RectangleF originalRectangle, float gradientPercentage, bool fillEllipse)
Parameters:graphicsGraphicscolor1Colorcolor2ColororiginalRectangleRectangleFgradientPercentagefloatfillEllipsebool
C#
public void FillPath(IFillElement element, Path path)
Parameters:elementIFillElementpathPath
C#
protected abstract void FillPathCore(Path path, RadBrush brush)
Parameters:pathPathbrushRadBrush
C#
public abstract void FillPolygon(RadBrush brush, PointF[] points)
Parameters:brushRadBrushpointsPointF[]
C#
public void FillRectangle(IFillElement element, RectangleF rect)
Parameters:elementIFillElementrectRectangleF
C#
public abstract void FillRectangle(RadBrush brush, float x, float y, float width, float height)
Parameters:brushRadBrushxfloatyfloatwidthfloatheightfloat
C#
protected void FillRectangle(RectangleF rectangle, RadBrush brush)
Parameters:rectangleRectangleFbrushRadBrush
C#
protected abstract void FillRoundedRectangleCore(RoundedRectangle roundedRectangle, RadBrush brush)
Parameters:roundedRectangleRoundedRectanglebrushRadBrush
C#
protected Color GetColor(Color original)
Parameters:originalColorReturns:

Color

C#
protected virtual GradientStop[] GetFillGelGradientStops(GradientStop[] colorStops, int colorCount)
Parameters:colorStopsGradientStop[]colorCountintReturns:

GradientStop[]

C#
protected virtual GradientStop[] GetFillRadialGradientStops(GradientStop[] colorStops, int colorCount, float gradientPercentage, float gradientPercentage2)
Parameters:colorStopsGradientStop[]colorCountintgradientPercentagefloatgradientPercentage2floatReturns:

GradientStop[]

C#
public abstract SizeF MeasureText(ITextElement element, SizeF availableSize)
Parameters:elementITextElementavailableSizeSizeFReturns:

SizeF

C#
public abstract SizeF MeasureText(string text, Font font, SizeF availableSize, TextFormat textFormat)
Parameters:textstringfontFontavailableSizeSizeFtextFormatTextFormatReturns:

SizeF

C#
protected Color ReduceAlphaBasedOnOriginal(int newAlpha, Color color)
Parameters:newAlphaintcolorColorReturns:

Color

In this article
DefinitionConstructorsSurface()Surface(object)PropertiesDeviceContextGraphicsOpacityResourcesMethodsBeginDraw(params object[])BeginEffects(Size)CreateDisplacementMapEffect()CreateGaussianBlurEffect()CreateLinearGradientBrush(RectangleF, GradientStop[], float)CreateLinearGradientBrush(RectangleF, GradientStop[], RadLinearGradientMode)CreateMorphologyEffect()CreatePath()CreateRadialBrush(PointF, float, float, GradientStop[])CreateRoundedRectangle(RectangleF, float)CreateSolidBrush(Color)DrawBorder(IBorderElement, Path)DrawBorder(IBorderElement, RectangleF)DrawEllipse(RectangleF, RadBrush, float)DrawImage(IImageElement, RectangleF)DrawImage(Image, RectangleF)DrawLine(RadBrush, float, float, float, float)DrawPathCore(Path, RadBrush, float)DrawRectangle(RadBrush, float, float, float, float)DrawRectangle(RectangleF, RadBrush, float)DrawText(ITextElement, RadBrush, RectangleF)DrawText(string, Font, RadBrush, RectangleF, TextFormat)EndDraw()EndEffects(EffectCollection)FillEllipse(RectangleF, RadBrush)FillOfficeGlass(Path, Color, Color, Color, Color, float, float, bool)FillOfficeGlassBottomGlow(Graphics, Color, Color, RectangleF, int, bool)FillOfficeGlassMain(Color, RectangleF, bool)FillOfficeGlassOuterBorder(RectangleF, Color, int, bool)FillOfficeGlassTopInnerBorder(RectangleF, Color, Color, int, bool)FillOfficeGlassTopInnerGlow(Graphics, Color, Color, RectangleF, bool)FillOfficeGlassTopLightGlow(Graphics, Color, Color, RectangleF, float, bool)FillPath(IFillElement, Path)FillPathCore(Path, RadBrush)FillPolygon(RadBrush, PointF[])FillRectangle(IFillElement, RectangleF)FillRectangle(RadBrush, float, float, float, float)FillRectangle(RectangleF, RadBrush)FillRoundedRectangleCore(RoundedRectangle, RadBrush)GetColor(Color)GetFillGelGradientStops(GradientStop[], int)GetFillRadialGradientStops(GradientStop[], int, float, float)MeasureText(ITextElement, SizeF)MeasureText(string, Font, SizeF, TextFormat)ReduceAlphaBasedOnOriginal(int, Color)
Not finding the help you need?
Contact Support