Table of Contents

Class GdiPainter

Namespace
Alternet.Common
Assembly
Alternet.Common.v9.dll

Encapsulates a Gdi drawing surface, providing properties and methods used to draw text and graphic primitives.

public class GdiPainter : Painter, IPainter, IDisposable
Inheritance
GdiPainter
Implements

Properties

Graphics

Represents Graphics object used to paint text and graphic primitives.

Handle

Gets handle to device context currently associated with the IPainter.

Transformation

Gets the world transformation for Graphics property.

UseDrawText

Indicates whether painter should use DrawText method rather then ExtTextOut to paint text.

Methods

BeginPaint(Graphics)

Prepares the GdiPainter to paint. Associates new device context from given Graphics object to GdiPainter and preserves GdiPainter properties. EndPaint()

CharWidth(char, int)

Returns width of the given number of specified character.

CharWidth(char, int, out int, bool)

Returns width of the such number of the specified characters fitting into the given Width.

Clear()

Resets all GdiPainter properties to the initial state.

ClearBrushes()
ClearPens()
CreateBrush(Color)
CreateFontInfos(Font)
CreateFontInfos(IntPtr)
CreatePen(Color, int)
DrawDotLine(int, int, int, int, Color, Color, int)

Draws a dotted line from the given start position up to the specified end point.

DrawEdge(ref Rectangle, Border3DStyle, Border3DSide)

Draws one or more edges of rectangle.

DrawEdge(ref Rectangle, Border3DStyle, Border3DSide, int)

Draws one or more edges of rectangle.

DrawFocusRect(Rectangle, Color)

Draws a border around the specified rectangle using current BackColor.

DrawFocusRect(int, int, int, int, Color)

Draws a border around the specified rectangle using dot pattern.

DrawFrameRect(Rectangle, Color, int)

Draws a border around the specified rectangle using current BackColor.

DrawImage(Image, Rectangle)

Draws image in the specified rectangular area.

DrawImage(ImageList, int, Rectangle)

Draws specified image in the specified rectangular area.

DrawImage(ImageList, int, Rectangle, int, int, int, int, GraphicsUnit, ImageAttributes)

Draws specified image in the specified rectangular area.

DrawLine(int, int, int, int)

Draws a line from the given start position up to, but not including, the specified end point.

DrawLine(int, int, int, int, Color, int, DashStyle)

Draws a line from the given start position up to, but not including, the specified end point.

DrawPolygon(Point[], Color)

Draws a polygon defined by an array of Point structures.

DrawRectangle(Rectangle)

Draws a border around the specified rectangle using current BackColor.

DrawRectangle(int, int, int, int)

Draws a border around the specified rectangle using current BackColor.

DrawRoundRectangle(int, int, int, int, int, int)

Draws a rectangle with rounded corners. The rectangle is outlined by using the current pen.

DrawText(string, int, Rectangle)

Draws text in the specified rectangle using current values of TextColor and BackColor.

DrawThemeBackground(IntPtr, int, int, Rectangle)

Draws the background image defined by the visual style for the specified control part.

DrawWave(Rectangle, Color)

Draws waved line in the specified rectangular area.

EndPaint()

Marks the end of painting. Releases device context associated with this GdiPainter and restores saved GdiPainter properties. BeginPaint(Graphics)

EndTransform()

Sets default two-dimensional linear transformation for the specified device context.

ExcludeClipRect(Rectangle)

Creates a new clipping region that consists of the existing clipping region minus the specified rectangle.

ExcludeClipRect(int, int, int, int)

Creates a new clipping region that consists of the existing clipping region minus the specified rectangle.

FillGradient(Rectangle, Color, Color, Point, Point)

Fills the given rectangle with color that smoothly fades from one side to the other.

FillGradient(int, int, int, int, Color, Color, Point, Point)

Fills the given rectangle with color that smoothly fades from one side to the other.

FillPolygon(Color, Point[])

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

FillRectangle(Color, Rectangle)

Fills the given rectangle by using specified color.

FillRectangle(Color, int, int, int, int)

Fills the given rectangle by using specified color.

FillRectangle(Rectangle)

Fills the given rectangle by using the current brush.

FillRectangle(int, int, int, int)

Fills the given rectangular area by using the current brush.

FillRoundRectangle(int, int, int, int, int, int)

Fills a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush.

GetBuffer(int)
GetBuffer(int, int)
IntersectClipRect(Rectangle)

Creates a new clipping region from the intersection of the current clipping region and the specified rectangle.

IntersectClipRect(int, int, int, int)

Creates a new clipping region from the intersection of the current clipping region and the specified rectangle.

OnUseDrawTextChanged()
RestoreClip(IntPtr)

Restores current clipping region from previously saved region.

SafeBeginPaint(Graphics)
SafeEndPaint()
SaveClip(Rectangle)

Retrieves handle to clipping region saved from specified rectangle.

SelectBrush(Color, bool)
SelectFont(Font, FontStyle)
SelectFont(FontStyle)
SelectOpaque(bool)
SelectPen(Color, bool)
SelectStringFormat(StringFormat?)
SelectTextColor(Color)
StringWidth(FontInfo?, string, int, int)
StringWidth(FontInfo?, string, int, int, int, out int, bool)
StringWidth(string)

Returns width of the given string.

StringWidth(string, int, int)

Returns width of the specified part of the given string.

StringWidth(string, int, int, int, out int)

Returns width of the specified part of the given string fitting into the given Width.

StringWidth(string, int, int, int, out int, bool)

Returns width of the specified part of the given string fitting into the given Width.

StringWidth(string, int, out int, bool)

Returns width of the given string fitting into the given Width.

TextOut(string, int, Rectangle)

Draws text within the specified rectangle.

TextOut(string, int, Rectangle, bool, bool)

Draws text within the specified rectangle.

TextOut(string, int, Rectangle, bool, bool, int)

Draws text within the specified rectangle.

TextOut(string, int, Rectangle, int, int, bool, bool)

Draws text within the specified rectangle.

TextOut(string, int, Rectangle, int, int, bool, bool, int)

Draws text within the specified rectangle.

TextOut(string, int, int, int)

Draws text in the specified location.

TextOut(string, int, int, int, bool, bool)

Draws text in the specified location.

Transform(int, int, float, float)

Sets a two-dimensional linear transformation for the specified device context.