[]
        
(Showing Draft Content)

C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext

DeviceContext Class

Represents the GDI device conext.

Namespace: C1.Framework.Drawing.Gdi.DeviceContexts
Assembly: C1.Win.Input.8.dll
Syntax
public abstract class DeviceContext : MarshalByRefObject, IDeviceContext, IDisposable

Constructors

Name Description
DeviceContext()

Properties

Name Description
BackgroundColor

Gets or sets the color of the background of the device context.

BackgroundMode

Gets or sets the background mode of the device context.

CircumDirection

Gets or sets the drawing direction of the circle shapes.

ClippingRegion

Gets or sets the handle of the current clipping region of the device context.

ForegroundColor

Gets or sets the color of the foreground of the device context.

GraphicsMode

Gets or sets a GraphicsMode indicating whether use the world transform in this DC.

Handle

Gets or [protected] sets the handle of the device context.

MappingMode

Gets or sets the mapping mode of the device context.

PixelsPerInchX

Gets the number of pixels per logical inch along the screen width. In a system with multiple display monitors, this value is the same for all monitors.

PixelsPerInchY

Gets the number of pixels per logical inch along the screen height. In a system with multiple display monitors, this value is the same for all monitors.

RasterOperationCode

Get or set the current foreground mix mode.GDI uses the foreground mix mode to combine pens and interiors of filled objects with the colors already on the screen. The foreground mix mode defines how colors from the brush or pen and the colors in the existing image are to be combined.

TextAlign

Gets or sets the text-alignment flags for this device context.

TextCharacterExtra

Gets or sets the current intercharacter spacing for the device context.

ViewportExtent

Gets or sets the x-extent and y-extent of the current viewport for the device context.

ViewportOrigin

Gets or sets the x-coordinates and y-coordinates of the viewport origin for the device context

WindowExtent

Gets or sets the x-extent and y-extent of the current window for the device context.

WindowOrigin

Gets or sets the x-coordinates and y-coordinates of the window origin for the device context

WorldTransform

Gets or sets the world transform.

Methods

Name Description
AlphaBlend(DeviceContext, Rectangle, Rectangle)

Displays bitmaps that have transparent or semitransparent pixels.

AlphaBlend(DeviceContext, Rectangle, Rectangle, byte)

Displays bitmaps with a constant transparent value.

Clip(Rectangle, CombineMode)

Clips the device context by the specified rectangle and operation mode.

Copy(DeviceContext, Rectangle, Point, RasterOperationCode)

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source DeviceContext object into a destination DeviceContext object.

Copy(DeviceContext, Rectangle, Rectangle, RasterOperationCode)

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source DeviceContext object into a destination DeviceContext object.

DeleteObject(nint)

Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.

Dispose()

Releases all resources used by this DeviceContext object.

Dispose(bool)

Releases the unmanaged resources used by the DeviceContext and optionally releases the managed resources.

DrawArc(Point, uint, float, float)

Draws a line segment and an arc. The line segment is drawn from the position which is defined by radius and startAngle. The arc is drawn along the perimeter of a circle with the given radius and center. The length of the arc is defined by the given start and sweep angles.

DrawArc(Rectangle, Point, Point)

Draws an elliptical arc.

DrawLine(Point, Point)

Draws the special line by using the current pen of the device context.

DrawPolyBezier(Point[])

Draws one or more Bezier curves.

DrawPolyLine(Point[])

Draws a series of line segments by connecting the points in the specified array.

DrawText(string, Rectangle, TextFormat)

Draws formatted text in the specified rectangle.

FillRectangle(Color, Color, Rectangle, bool)

Gradient fills the rectangle with colors.

FillRectangle(Rectangle, RasterOperationCode)

Fills the specified rectangle by using the current brush of device context.

FillRectangle(nint, Rectangle)

Fills the specified rectangle by using the specified brush.

FillRegion(nint, nint)

Fills the region by the specified brush.

FillRegionFrame(nint, nint, Size)

Draws a border around the specified region by using the specified brush.

FillTriangle(Color, Color, Color, Point, Point, Point)

Gradient fills the triangle with specified colors.

~DeviceContext()

Deletes this DeviceContext, and frees the memory allocated for it.

GetCircleDirection()

Gets the drawing direction of the circle shapes.

GetClippingBox()

Retrieves the dimensions of the tightest bounding rectangle that can be drawn around the current visible area on the device. The visible area is defined by the current clipping region or clip path, as well as any overlapping windows.

GetPixel(Point)

retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.

GetRasterOperationCode()

retrieves the foreground mix mode of the specified device context. The mix mode specifies how the pen or interior color and the color already on the screen are combined to yield a new color.

InvertRectangle(Rectangle)

Inverts a rectangle in a window by performing a logical NOT operation on the color values for each pixel in the rectangle's interior.

InvertRegion(nint)

Inverts the colors in the specified region.

MeasureText(string, Size, TextFormat)

Draws formatted text in the specified rectangle.

PaintChord(Rectangle, Point, Point)

Paints a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant). The chord is outlined by using the current pen and filled by using the current brush.

PaintEllipse(Rectangle)

Paints an ellipse. The center of the ellipse is the center of the specified bounding rectangle. The ellipse is outlined by using the current pen and is filled by using the current brush.

PaintPie(Rectangle, Point, Point)

Paints a pie-shaped wedge bounded by the intersection of an ellipse and two radials. The pie is outlined by using the current pen and filled by using the current brush.

PaintPolygon(Point[])

Paints a polygon consisting of two or more vertices connected by straight lines. The polygon is outlined by using the current pen and filled by using the current brush and polygon fill mode.

PaintRectangle(Rectangle)

Draw the special rectangle by using the current pen of the device context and fill the rectangle by using the current brush of the device context.

PaintRoundRectangle(Rectangle, int, int)

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

PointDeviceToLogical(Point[])

converts device coordinates into logical coordinates. The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation.

PointLogicalToDevice(Point[])

converts logical coordinates into device coordinates. The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation.

Restore(DeviceContextState)

Restores the state of this Graphics object to the state represented by a handle.

Save()

Saves the current state of this Graphics object and identifies the saved state with a handle.

ScaleViewport(int, int, int, int)

Modifies the viewport for a device context using the ratios formed by the specified multiplicands and divisors.

ScaleWindow(int, int, int, int)

Modifies the window for a device context using the ratios formed by the specified multiplicands and divisors.

SelectObject(nint)

Selects an object into the specified device context(DC). The new object replaces the previous object of the same type.

SetBackgroundColor(Color)

Sets the color of the background of the device context.

SetBackgroundMode(BackgroundMode)

Sets the background mode of the device context.

SetCircumDirection(CircumDirection)

Sets the drawing direction of the circle shapes.

SetClippingRegion(nint, CombineMode)

Combines the specified region with the current clipping region using the specified mode.

SetForegroundColor(Color)

Sets the color of the foreground of the device context.

SetPixel(Color, Point)

Sets the pixel at the specified coordinates to the closest approximation of the specified color. The point must be in the clipping region and the visible part of the device surface.

SetRasterOperationCode(RasterOperationCode)

Sets the current foreground mix mode. GDI uses the foreground mix mode to combine pens and interiors of filled objects with the colors already on the screen. The foreground mix mode defines how colors from the brush or pen and the colors in the existing image are to be combined.

SetTextAlign(TextAlignment)

Sets the text-alignment flags for this device context.

SetTextCharacterExtra(int)

Sets the current intercharacter spacing for the device context.

SetTextJustification(int, int)

Specifies the amount of space the system should add to the break characters in a string of text. The space is added when an application calls the TextOut method.

TabbedTextExtent(string, int[], out Size)

The TabbedTextExtent method computes the width and height of a character string.If the string contains one or more tab characters, the width of the string is based upon the specified tab stops. The TabbedTextExtent method uses the currently selected font to compute the dimensions of the string.

TabbedTextOut(string, Point, int[], int)

Writes a character string at a specified location, expanding tabs to the values specified in an array of tab-stop positions. Text is written in the currently selected font, background color, and text color.

TextExtent(string)

Computes the width and height of the specified string of text.

TextExtentEx(string, int, out int, int[])

Retrieves the number of characters in a specified string that will fit within a specified space and fills an array with the text extent for each of those characters.

TextOut(string, Point)

Writes a character string at the specified location, using the currently selected font, background color, and text color.

TranslateClippingRegion(int, int)

Moves the clipping region of a device context by the specified offsets.

TranslateViewport(int, int)

Modifies the viewport origin for a device context using the specified horizontal and vertical offsets.

TranslateWindow(int, int)

Modifies the window origin for a device context using the specified horizontal and vertical offsets.