Gdi32 Class

Platform Invocation methods (P/Invoke), access unmanaged code.

Gdi32.dll.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[HideModuleNameAttribute]
public sealed class Gdi32
Inheritance
Object    Gdi32

Methods

BitBlt(IntPtr, Int32, Int32, Int32, Int32, IntPtr, Int32, Int32, TernaryRasterOperations) Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
BitBlt(SafeHandle, Int32, Int32, Int32, Int32, SafeHandle, Int32, Int32, TernaryRasterOperations) Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
CombineRgn Combines two regions and stores the result in a third region.

The two regions are combined according to the specified mode.

CreateCompatibleBitmap(IntPtr, Int32, Int32) Creates a bitmap compatible with the device that is associated with the specified device context.
CreateCompatibleBitmap(SafeHandle, Int32, Int32) Creates a bitmap compatible with the device that is associated with the specified device context.
CreateCompatibleDC(IntPtr) Creates a memory device context (DC) compatible with the specified device.
CreateCompatibleDC(SafeHandle) Creates a memory device context (DC) compatible with the specified device.
CreateDC Creates a device context (DC) for a device using the specified name.
CreateEllipticRgn Creates an elliptical region.
CreateEllipticRgnIndirect(NativeRectangle) Creates an elliptical region.
CreateEllipticRgnIndirect(Rectangle) Creates an elliptical region.
CreateEnhMetaFile(IntPtr, String, NativeRectangle, String) Creates a device context (DC) for an enhanced-format metafile.

This device context can be used to store a device-independent picture.

CreateEnhMetaFile(IntPtr, String, Rectangle, String) Creates a device context (DC) for an enhanced-format metafile.

This device context can be used to store a device-independent picture.

CreatePolygonRgn(NativePoint, Int32, FillMode) Creates a polygonal region.
CreatePolygonRgn(Point, Int32, FillMode) Creates a polygonal region.
CreatePolyPolygonRgn(NativePoint, Int32, Int32, FillMode) Creates a region consisting of a series of polygons. The polygons can overlap.
CreatePolyPolygonRgn(Point, Int32, Int32, FillMode) Creates a region consisting of a series of polygons. The polygons can overlap.
CreateRectRgn Creates a rectangular region.
CreateRectRgnIndirect(NativeRectangle) Creates a rectangular region.
CreateRectRgnIndirect(Rectangle) Creates a rectangular region.
CreateRoundRectRgn Creates a rectangular region with rounded corners.
CreateSolidBrush Creates a logical brush that has the specified solid color.

A solid brush is a bitmap that the system uses to paint the interiors of filled shapes.

After an application creates a brush by calling CreateSolidBrush(UInt32), it can select that brush into any device context by calling the SelectObject(IntPtr, IntPtr) function.

When you no longer need the brush, call the DeleteObject(IntPtr) function to delete it.

DeleteDC(IntPtr) Deletes the specified device context (DC).

An application must not delete a DC whose handle was obtained by calling the GetDC(IntPtr) function. instead, it must call the ReleaseDC(IntPtr, IntPtr) function to free the DC.

DeleteDC(SafeHandle) Deletes the specified device context (DC).

An application must not delete a DC whose handle was obtained by calling the GetDC(IntPtr) function. instead, it must call the ReleaseDC(IntPtr, IntPtr) function to free the DC.

DeleteEnhMetaFile Deletes an enhanced-format metafile or an enhanced-format metafile handle.
DeleteObject(HandleRef) 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.

Do not delete a drawing object (pen or brush) while it is still selected into a DC.

When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently.

DeleteObject(IntPtr) 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.

Do not delete a drawing object (pen or brush) while it is still selected into a DC.

When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently.

DeleteObject(SafeHandle) 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.

Do not delete a drawing object (pen or brush) while it is still selected into a DC.

When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently.

EqualRgn Checks the two specified regions to determine whether they are identical.

The function considers two regions identical if they are equal in size and shape.

Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
ExtTextOut(IntPtr, Int32, Int32, ExtTextOutOptions, NativeRectangle, String, UInt32, Int32) Draws text using the currently selected font, background color, and text color.

You can optionally provide dimensions to be used for clipping, opaquing, or both.

ExtTextOut(IntPtr, Int32, Int32, ExtTextOutOptions, Rectangle, String, UInt32, Int32) Draws text using the currently selected font, background color, and text color.

You can optionally provide dimensions to be used for clipping, opaquing, or both.

ExtTextOut(SafeHandle, Int32, Int32, ExtTextOutOptions, NativeRectangle, String, UInt32, Int32) Draws text using the currently selected font, background color, and text color.

You can optionally provide dimensions to be used for clipping, opaquing, or both.

ExtTextOut(SafeHandle, Int32, Int32, ExtTextOutOptions, Rectangle, String, UInt32, Int32) Draws text using the currently selected font, background color, and text color.

You can optionally provide dimensions to be used for clipping, opaquing, or both.

FillRgn Fills a region by using the specified brush.
FrameRgn Draws a border around the specified region by using the specified brush.
GdiFlush Flushes the calling thread's current batch.
GetClipBox(IntPtr, NativeRectangle) 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.

GetClipBox(IntPtr, Rectangle) 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.

GetClipBox(SafeHandle, NativeRectangle) 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.

GetClipBox(SafeHandle, Rectangle) 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.

GetClipRgn(IntPtr, IntPtr) Retrieves a handle identifying the current application-defined clipping region for the specified device context.
GetClipRgn(SafeHandle, IntPtr) Retrieves a handle identifying the current application-defined clipping region for the specified device context.
GetDeviceCaps(IntPtr, Int32) Retrieves device-specific information for the specified device.
GetDeviceCaps(SafeHandle, Int32) Retrieves device-specific information for the specified device.
GetEnhMetaFile Creates a handle that identifies the enhanced-format metafile stored in the specified file.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetObject Retrieves information for the specified graphics object.
GetPixel(IntPtr, Int32, Int32) Retrieves the Red, Green, Blue (RGB) color value of the pixel at the specified coordinates.
GetPixel(SafeHandle, Int32, Int32) Retrieves the Red, Green, Blue (RGB) color value of the pixel at the specified coordinates.
GetPolyFillMode Retrieves the current polygon fill mode.
GetRgnBox(IntPtr, NativeRectangle) Retrieves the bounding rectangle of the specified region.
GetRgnBox(IntPtr, Rectangle) Retrieves the bounding rectangle of the specified region.
GetStockObject Retrieves a handle to one of the stock pens, brushes, fonts, or palettes.
GetTextMetricsA(HandleRef, TextMetricA) Fills the specified buffer with the metrics for the currently selected font.
GetTextMetricsA(IntPtr, TextMetricA) Fills the specified buffer with the metrics for the currently selected font.
GetTextMetricsA(SafeHandle, TextMetricA) Fills the specified buffer with the metrics for the currently selected font.
GetTextMetricsW(HandleRef, TextMetricW) Fills the specified buffer with the metrics for the currently selected font.
GetTextMetricsW(IntPtr, TextMetricW) Fills the specified buffer with the metrics for the currently selected font.
GetTextMetricsW(SafeHandle, TextMetricW) Fills the specified buffer with the metrics for the currently selected font.
GetType Gets the Type of the current instance.
(Inherited from Object)
InvertRgn Inverts the colors in the specified region.
OffsetRgn Moves a region by the specified offsets.
PaintRgn Paints the specified region by using the brush currently selected into the device context.
PtInRegion(IntPtr, Int32, Int32) Determines whether the specified point is inside the specified region.
PtInRegion(SafeHandle, Int32, Int32) Determines whether the specified point is inside the specified region.
PtVisible(IntPtr, Int32, Int32) Determines whether the specified point is within the clipping region of a device context.
PtVisible(SafeHandle, Int32, Int32) Determines whether the specified point is within the clipping region of a device context.
RectInRegion(IntPtr, NativeRectangle) Determines whether any part of the specified rectangle is within the boundaries of a region.
RectInRegion(IntPtr, Rectangle) Determines whether any part of the specified rectangle is within the boundaries of a region.
RectVisible(IntPtr, NativeRectangle) Determines whether any part of the specified rectangle lies within the clipping region of a device context.
RectVisible(IntPtr, Rectangle) Determines whether any part of the specified rectangle lies within the clipping region of a device context.
RectVisible(SafeHandle, NativeRectangle) Determines whether any part of the specified rectangle lies within the clipping region of a device context.
RectVisible(SafeHandle, Rectangle) Determines whether any part of the specified rectangle lies within the clipping region of a device context.
SelectObject(HandleRef, HandleRef) Selects an object into a specified device context.

The new object replaces the previous object of the same type.

SelectObject(IntPtr, IntPtr) Selects an object into a specified device context.

The new object replaces the previous object of the same type.

SelectObject(SafeHandle, SafeHandle) Selects an object into a specified device context.

The new object replaces the previous object of the same type.

SetBkColor Sets the current background color to the specified color value, or to the nearest physical color if the device cannot represent the specified color value.
SetBkMode Sts the background mix mode of the specified device context (DC).

The background mix mode is used with text, hatched brushes, and pen styles that are not solid lines.

SetPolyFillMode Sets the polygon fill mode for functions that fill polygons.
SetTextColor Sets the text color for the specified device context to the specified color.
SwapBuffers Exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer.
ToString Returns a string that represents the current object.
(Inherited from Object)
UpdateColors Updates the client area of the specified device context by remapping the current colors in the client area to the currently realized logical palette.

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also