Class RGraphics
Adapter for platform specific graphics rendering object - used to render graphics and text in platform specific context.
The core HTML Renderer components use this class for rendering logic, extending this
class in different platform: WinForms, WPF, Metro, PDF, etc.
Inheritance
Inherited Members
Namespace: TheArtOfDev.HtmlRenderer.Adapters
Assembly: Telerik.WinControls.RadMap.dll
Syntax
public abstract class RGraphics : IDisposable
Constructors
RGraphics(RAdapter, RRect)
Init.
Declaration
protected RGraphics(RAdapter adapter, RRect initialClip)
Parameters
|
RAdapter
adapter
|
|
RRect
initialClip
|
Fields
adapter
clipStack
The clipping bound stack as clips are pushed/poped to/from the graphics
Declaration
protected readonly Stack<RRect> clipStack
Field Value
|
System.Collections.Generic.Stack<RRect>
|
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public abstract void Dispose()
Implements
DrawImage(RImage, RRect)
Draws the specified Image at the specified location and with the specified size.
Declaration
public abstract void DrawImage(RImage image, RRect destRect)
Parameters
|
RImage
image
Image to draw. |
|
RRect
destRect
Rectangle structure that specifies the location and size of the drawn image. |
DrawImage(RImage, RRect, RRect)
Draws the specified portion of the specified RImage at the specified location and with the specified size.
Declaration
public abstract void DrawImage(RImage image, RRect destRect, RRect srcRect)
Parameters
|
RImage
image
Image to draw. |
|
RRect
destRect
Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
|
RRect
srcRect
Rectangle structure that specifies the portion of the |
DrawLine(RPen, Double, Double, Double, Double)
Draws a line connecting the two points specified by the coordinate pairs.
Declaration
public abstract void DrawLine(RPen pen, double x1, double y1, double x2, double y2)
Parameters
|
RPen
pen
Pen that determines the color, width, and style of the line. |
|
System.Double
x1
The x-coordinate of the first point. |
|
System.Double
y1
The y-coordinate of the first point. |
|
System.Double
x2
The x-coordinate of the second point. |
|
System.Double
y2
The y-coordinate of the second point. |
DrawPath(RBrush, RGraphicsPath)
Fills the interior of a GraphicsPath.
Declaration
public abstract void DrawPath(RBrush brush, RGraphicsPath path)
Parameters
|
RBrush
brush
Brush that determines the characteristics of the fill. |
|
RGraphicsPath
path
GraphicsPath that represents the path to fill. |
DrawPath(RPen, RGraphicsPath)
Draws a GraphicsPath.
Declaration
public abstract void DrawPath(RPen pen, RGraphicsPath path)
Parameters
|
RPen
pen
Pen that determines the color, width, and style of the path. |
|
RGraphicsPath
path
GraphicsPath to draw. |
DrawPolygon(RBrush, RPoint[])
Fills the interior of a polygon defined by an array of points specified by Point structures.
Declaration
public abstract void DrawPolygon(RBrush brush, RPoint[] points)
Parameters
|
RBrush
brush
Brush that determines the characteristics of the fill. |
|
RPoint[]
points
Array of Point structures that represent the vertices of the polygon to fill. |
DrawRectangle(RBrush, Double, Double, Double, Double)
Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
Declaration
public abstract void DrawRectangle(RBrush brush, double x, double y, double width, double height)
Parameters
|
RBrush
brush
Brush that determines the characteristics of the fill. |
|
System.Double
x
The x-coordinate of the upper-left corner of the rectangle to fill. |
|
System.Double
y
The y-coordinate of the upper-left corner of the rectangle to fill. |
|
System.Double
width
Width of the rectangle to fill. |
|
System.Double
height
Height of the rectangle to fill. |
DrawRectangle(RPen, Double, Double, Double, Double)
Draws a rectangle specified by a coordinate pair, a width, and a height.
Declaration
public abstract void DrawRectangle(RPen pen, double x, double y, double width, double height)
Parameters
|
RPen
pen
A Pen that determines the color, width, and style of the rectangle. |
|
System.Double
x
The x-coordinate of the upper-left corner of the rectangle to draw. |
|
System.Double
y
The y-coordinate of the upper-left corner of the rectangle to draw. |
|
System.Double
width
The width of the rectangle to draw. |
|
System.Double
height
The height of the rectangle to draw. |
DrawString(String, RFont, RColor, RPoint, RSize, Boolean)
Draw the given string using the given font and foreground color at given location.
Declaration
public abstract void DrawString(string str, RFont font, RColor color, RPoint point, RSize size, bool rtl)
Parameters
|
System.String
str
the string to draw |
|
RFont
font
the font to use to draw the string |
|
RColor
color
the text color to set |
|
RPoint
point
the location to start string draw (top-left) |
|
RSize
size
used to know the size of the rendered text for transparent text support |
|
System.Boolean
rtl
is to render the string right-to-left (true - RTL, false - LTR) |
GetClip()
Gets a Rectangle structure that bounds the clipping region of this Graphics.
Declaration
public RRect GetClip()
Returns
|
RRect
A rectangle structure that represents a bounding rectangle for the clipping region of this Graphics. |
GetGraphicsPath()
Get GraphicsPath object.
Declaration
public abstract RGraphicsPath GetGraphicsPath()
Returns
|
RGraphicsPath
graphics path instance |
GetLinearGradientBrush(RRect, RColor, RColor, Double)
Get linear gradient color brush from color1 to color2.
Declaration
public RBrush GetLinearGradientBrush(RRect rect, RColor color1, RColor color2, double angle)
Parameters
|
RRect
rect
the rectangle to get the brush for |
|
RColor
color1
the start color of the gradient |
|
RColor
color2
the end color of the gradient |
|
System.Double
angle
the angle to move the gradient from start color to end color in the rectangle |
Returns
|
RBrush
linear gradient color brush instance |
GetPen(RColor)
Get color pen.
Declaration
public RPen GetPen(RColor color)
Parameters
|
RColor
color
the color to get the pen for |
Returns
|
RPen
pen instance |
GetSolidBrush(RColor)
Get solid color brush.
Declaration
public RBrush GetSolidBrush(RColor color)
Parameters
|
RColor
color
the color to get the brush for |
Returns
|
RBrush
solid color brush instance |
GetTextureBrush(RImage, RRect, RPoint)
Get TextureBrush object that uses the specified image and bounding rectangle.
Declaration
public abstract RBrush GetTextureBrush(RImage image, RRect dstRect, RPoint translateTransformLocation)
Parameters
|
RImage
image
The Image object with which this TextureBrush object fills interiors. |
|
RRect
dstRect
A Rectangle structure that represents the bounding rectangle for this TextureBrush object. |
|
RPoint
translateTransformLocation
The dimension by which to translate the transformation |
Returns
|
RBrush
|
MeasureString(String, RFont)
Measure the width and height of string str when drawn on device context HDC
using the given font font.
Declaration
public abstract RSize MeasureString(string str, RFont font)
Parameters
|
System.String
str
the string to measure |
|
RFont
font
the font to measure string with |
Returns
|
RSize
the size of the string |
MeasureString(String, RFont, Double, out Int32, out Double)
Measure the width of string under max width restriction calculating the number of characters that can fit and the width those characters take.
Not relevant for platforms that don't render HTML on UI element.
Declaration
public abstract void MeasureString(string str, RFont font, double maxWidth, out int charFit, out double charFitWidth)
Parameters
|
System.String
str
the string to measure |
|
RFont
font
the font to measure string with |
|
System.Double
maxWidth
the max width to calculate fit characters |
|
System.Int32
charFit
the number of characters that will fit under maxWidth restriction |
|
System.Double
charFitWidth
the width that only the characters that fit into max width take |
PopClip()
Pop the latest clip push.
Declaration
public abstract void PopClip()
PushClip(RRect)
Push the clipping region of this Graphics to interception of current clipping rectangle and the given rectangle.
Declaration
public abstract void PushClip(RRect rect)
Parameters
|
RRect
rect
Rectangle to clip to. |
PushClipExclude(RRect)
Push the clipping region of this Graphics to exclude the given rectangle from the current clipping rectangle.
Declaration
public abstract void PushClipExclude(RRect rect)
Parameters
|
RRect
rect
Rectangle to exclude clipping in. |
ResumeClipping()
Resumes the suspended clips.
Declaration
public void ResumeClipping()
ReturnPreviousSmoothingMode(Object)
Return to previous smooth mode before anti-alias was set as returned from SetAntiAliasSmoothingMode().
Declaration
public abstract void ReturnPreviousSmoothingMode(object prevMode)
Parameters
|
System.Object
prevMode
the previous mode to set |
SetAntiAliasSmoothingMode()
Set the graphics smooth mode to use anti-alias.
Use ReturnPreviousSmoothingMode(Object) to return back the mode used.
Declaration
public abstract object SetAntiAliasSmoothingMode()
Returns
|
System.Object
the previous smooth mode before the change |
SuspendClipping()
Restore the clipping region to the initial clip.
Declaration
public void SuspendClipping()