Table of Contents

Class Graphics

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Defines a custom drawing surface.

public abstract class Graphics : DisposableObject, IBaseObject, IDisposableObject, IGraphics, IDisposable
Inheritance
Graphics
Implements
Derived
Extension Methods

Properties

Clip

Gets or sets clipping region.

HorizontalScaleFactor

Gets horizontal scale factor.

InterpolationMode

Gets or sets the interpolation mode associated with this Graphics.

IsOk

Returns true if the object is ok to use.

Name

Gets or sets name of the Graphics for the debug purposes.

NativeObject

Gets native drawing context.

ScaleFactor

Gets used scale factor.

Transform

Gets or sets a copy of the geometric world transformation for this Graphics.

VerrticalScaleFactor

Gets vertical scale factor.

Methods

Blit(PointD, SizeD, Graphics, PointD, RasterOperationMode, bool, PointD?, GraphicsUnit)

Copy from a source Graphics to this graphics. With this method you can specify the destination coordinates and the size of area to copy which will be the same for both the source and target. If you need to apply scaling while copying, use StretchBlit(PointD, SizeD, Graphics, PointD, SizeD, RasterOperationMode, bool, PointD?, GraphicsUnit). Sizes and positions are specified in pixels.

Circle(Pen, Brush, PointD, double)

Calls FillCircle(Brush, PointD, double) and than DrawCircle(Pen, PointD, double).

DebugAssert(Pen, Brush)

Checks whether Pen and Brush parameters are ok.

DebugBezierPointsAssert(PointD[])

Checks whether array of PointD parameter is ok.

DebugBrushAssert(Brush)

Checks whether Brush parameter is ok.

DebugColorAssert(Color, string?)

Checks whether Color parameter is ok.

DebugFontAssert(Font)

Checks whether Font parameter is ok.

DebugFormatAssert(TextFormat)

Checks whether TextFormat parameter is ok.

DebugImageAssert(Image)

Checks whether Image parameter is ok.

DebugPenAssert(Pen)

Checks whether Pen parameter is ok.

DebugSolidBrushAssert(Brush)

Checks whether SolidBrush parameter is ok.

DebugTextAssert(string)

Checks whether string parameter is ok.

DestroyClippingRegion()

Destroys the current clipping region so that none of the DC is clipped.

DrawArc(Pen, PointD, double, double, double)

Draws an arc representing a portion of a circle specified by a center PointD and a radius.

DrawBezier(Pen, PointD, PointD, PointD, PointD)

Draws a Bezier spline defined by four PointD structures.

DrawBeziers(Pen, PointD[])

Draws a series of Bezier splines from an array of PointD structures.

DrawCircle(Pen, PointD, double)

Draws an circle specified by a center PointD and a radius.

DrawDebugPoints(RectD, Pen?)

Draws debug points on the corners of the specified rectangle.

DrawEllipse(Pen, RectD)

Draws an ellipse defined by a bounding RectD.

DrawImage(Image, PointD)

Draws the specified Image, using its original size, at the specified location.

DrawImage(Image, RectD)

Draws an image into the region defined by the specified RectD.

DrawImage(Image, RectD, RectD)

Draws the specified portion of the image into the region defined by the specified RectD.

DrawImage(Image, RectD, RectD, GraphicsUnit)

Draws the specified portion of the image into the region defined by the specified RectD.

DrawImageUnscaled(Image, PointD)

Draws the specified Image, using its original size, at the specified location.

DrawLabel(string, Font, Color, Color, Image?, RectD, GenericAlignment, int)

Draws text with the specified font, background and foreground colors, optional image, alignment and underlined mnemonic character.

DrawLine(Pen, PointD, PointD)

Draws a line connecting two points.

DrawLine(Pen, double, double, double, double)

Draws a line connecting two points.

DrawLines(Pen, PointD[])

Draws a series of line segments that connect an array of PointD structures.

DrawPath(Pen, GraphicsPath)

Draws a GraphicsPath.

DrawPie(Pen, PointD, double, double, double)

Draws an outline of a pie section defined by a circle specified by a center PointD and a radius.

DrawPoint(Pen, double, double)

Draws point with the specified color.

DrawPolygon(Pen, PointD[])

Draws a polygon defined by an array of PointD structures.

DrawRectangle(Pen, RectD)

Draws a rectangle specified by a RectD structure.

DrawRectangles(Pen, RectD[])

Draws a series of rectangles specified by RectD structures.

DrawRotatedText(string, PointD, Font, Color, Color, double, GraphicsUnit)

Draws the text rotated by angle degrees (positive angles are counterclockwise; the full angle is 360 degrees) with the specified font, background and foreground colors.

DrawRoundedRectangle(Pen, RectD, double)

Draws a rounded rectangle specified by a RectD and a corner radius.

DrawText(string, Font, Brush, PointD)

Draws the specified text string at the specified location with the specified Brush and Font objects.

DrawText(string, Font, Brush, RectD)

Draws the specified text string at the specified location with the specified Brush and Font objects.

DrawText(string, PointD)

Draws text with DefaultFont and Default.

DrawText(string, PointD, Font, Color, Color)

Draws text with the specified font, background and foreground colors.

DrawText(string[], Font, Brush, PointD)

Draws multiple text strings at the specified location with the specified Brush and Font objects.

DrawWave(RectD, Color)

Draws waved line in the specified rectangular area.

Ellipse(Pen, Brush, RectD)

Calls FillEllipse(Brush, RectD) and than DrawEllipse(Pen, RectD).

FillCircle(Brush, PointD, double)

Fills the interior of a circle specified by a center PointD and a radius.

FillEllipse(Brush, RectD)

Fills the interior of an ellipse defined by a bounding rectangle specified by a RectD structure.

FillPath(Brush, GraphicsPath)

Fills the interior of a GraphicsPath.

FillPie(Brush, PointD, double, double, double)

Fills the interior of a pie section defined by a circle specified by a center PointD and a radius.

FillPolygon(Brush, PointD[], FillMode)

Fills the interior of a polygon defined by an array of PointD structures.

FillRectangle(Brush, RectD)

Fills the interior of a rectangle specified by a RectD structure. Rectangle is specified in device-independent units.

FillRectangle(Brush, RectD, GraphicsUnit)

Fills the interior of a rectangle specified by a RectD structure. Rectangle is specified in device-independent units.

FillRectangles(Brush, RectD[])

Fills a series of rectangles specified by RectD structures.

FillRoundedRectangle(Brush, RectD, double)

Fills the interior of a rounded rectangle specified by a RectD and a corner radius.

FloodFill(Brush, PointD)

Flood fills the drawing surface starting from the given point, using the given brush.

FromImage(Image)

Creates a new Graphics from the specified Image.

FromScreen()

Creates Graphics that can be used to paint on the screen.

GetClippingBox()

Gets the rectangle surrounding the current clipping region. If no clipping region is set this function returns the extent of the device context.

GetDPI()

Returns the DPI of the display used by this object.

GetTextExtent(string, Font)

Gets the dimensions of the string using the specified font.

GetTextExtent(string, Font, IControl?)

Gets the dimensions of the string using the specified font.

MeasureText(string, Font)

Measures the specified string when drawn with the specified Font.

Path(Pen, Brush, GraphicsPath)

Calls FillPath(Brush, GraphicsPath) and than DrawPath(Pen, GraphicsPath).

Pie(Pen, Brush, PointD, double, double, double)

Calls FillPie(Brush, PointD, double, double, double) and than DrawPie(Pen, PointD, double, double, double).

Polygon(Pen, Brush, PointD[], FillMode)

Calls FillPolygon(Brush, PointD[], FillMode) and than DrawPolygon(Pen, PointD[]).

Pop()

Pops a stored state from the stack and sets the current transformation matrix to that state.

Push()

Pushes the current state of the transformation matrix on a stack.

PushTransform(TransformMatrix)

Pushes the current state of the Graphics transformation matrix on a stack and concatenates the current transform with a new transform.

Rectangle(Pen, Brush, RectD)

Calls FillRectangle(Brush, RectD) and than DrawRectangle(Pen, RectD).

RoundedRectangle(Pen, Brush, RectD, double)

Calls FillRoundedRectangle(Brush, RectD, double) and than DrawRoundedRectangle(Pen, RectD, double).

SetClippingRegion(RectD)

Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region.

SetPixel(PointD, Pen)

Sets the color of the specified pixel in this Graphics.

SetPixel(double, double, Color)

Sets the color of the specified pixel in this Graphics.

SetPixel(double, double, Pen)

Sets the color of the specified pixel in this Graphics.

StretchBlit(PointD, SizeD, Graphics, PointD, SizeD, RasterOperationMode, bool, PointD?, GraphicsUnit)

Copies from a source Graphics to this graphics possibly changing the scale. Unlike Blit(PointD, SizeD, Graphics, PointD, RasterOperationMode, bool, PointD?, GraphicsUnit), this method allows specifying different source and destination region sizes, meaning that it can stretch or shrink it while copying. The meaning of its other parameters is the same as with Blit(PointD, SizeD, Graphics, PointD, RasterOperationMode, bool, PointD?, GraphicsUnit). Sizes and positions are specified in pixels.

ToDip(ref PointD, GraphicsUnit)

Converts point to device-independent units.

ToDip(ref RectD, GraphicsUnit)

Converts rectangle to device-independent units.

ToDip(ref SizeD, GraphicsUnit)

Converts SizeD to device-independent units.