skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

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
System.Object
RGraphics
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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

the global adapter

Declaration
protected readonly RAdapter adapter
Field Value
RAdapter

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
System.IDisposable.Dispose()

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 image object to draw.

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()

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.