gdi32 topic
Windows GDI
The Windows Graphics Device Interface, which provides functions that perform primitive drawing functions for output to video displays and printers. Traditional Windows applications call GDI functions directly to perform low-level drawing (line, rectangle, ellipse), text output, font management, and similar functions.
Functions
-
AbortPath(
HDC hdc) → bool gdi32 - Closes and discards any paths in the specified device context.
-
AddFontResource(
PCWSTR param0) → int gdi32 - Adds the font resource from the specified file to the system font table.
-
AddFontResourceEx(
PCWSTR name, FONT_RESOURCE_CHARACTERISTICS fl) → int gdi32 - Adds the font resource from the specified file to the system.
-
AngleArc(
HDC hdc, int x, int y, int r, double startAngle, double sweepAngle) → bool gdi32 - Draws a line segment and an arc.
-
AnimatePalette(
HPALETTE hPal, int iStartIndex, int cEntries, Pointer< gdi32PALETTEENTRY> ppe) → bool - Replaces entries in the specified logical palette.
-
Arc(
HDC hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) → bool gdi32 - Draws an elliptical arc.
-
ArcTo(
HDC hdc, int left, int top, int right, int bottom, int xr1, int yr1, int xr2, int yr2) → bool gdi32 - Draws an elliptical arc.
-
BeginPath(
HDC hdc) → bool gdi32 - Opens a path bracket in the specified device context.
-
BitBlt(
HDC hdc, int x, int y, int cx, int cy, HDC? hdcSrc, int x1, int y1, ROP_CODE rop) → Win32Result< gdi32bool> - 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.
-
CancelDC(
HDC hdc) → bool gdi32 - Cancels any pending operation on the specified device context (DC).
-
Chord(
HDC hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) → bool gdi32 - Draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant).
-
CloseFigure(
HDC hdc) → bool gdi32 - Closes an open figure in a path.
-
CreateBitmap(
int nWidth, int nHeight, int nPlanes, int nBitCount, Pointer< gdi32NativeType> ? lpBits) → HBITMAP - Creates a bitmap with the specified width, height, and color format (color planes and bits-per-pixel).
-
CreateBitmapIndirect(
Pointer< gdi32BITMAP> pbm) → HBITMAP - Creates a bitmap with the specified width, height, and color format (color planes and bits-per-pixel).
-
CreateCompatibleBitmap(
HDC hdc, int cx, int cy) → HBITMAP gdi32 - Creates a bitmap compatible with the device that is associated with the specified device context.
-
CreateCompatibleDC(
HDC? hdc) → HDC gdi32 - Creates a memory device context (DC) compatible with the specified device.
-
CreateDC(
PCWSTR? pwszDriver, PCWSTR? pwszDevice, PCWSTR? pszPort, Pointer< gdi32DEVMODE> ? pdm) → HDC - Creates a device context (DC) for a device using the specified name.
-
CreateDIBitmap(
HDC hdc, Pointer< gdi32BITMAPINFOHEADER> ? pbmih, int flInit, Pointer<NativeType> ? pjBits, Pointer<BITMAPINFO> ? pbmi, DIB_USAGE iUsage) → HBITMAP - Creates a compatible bitmap (DDB) from a DIB and, optionally, sets the bitmap bits.
-
CreateDIBPatternBrushPt(
Pointer< gdi32NativeType> lpPackedDIB, DIB_USAGE iUsage) → HBRUSH - Creates a logical brush that has the pattern specified by the device-independent bitmap (DIB).
-
CreateDIBSection(
HDC? hdc, Pointer< gdi32BITMAPINFO> pbmi, DIB_USAGE usage, Pointer<Pointer< ppvBits, HANDLE? hSection, int offset) → Win32Result<NativeType> >HBITMAP> - Creates a DIB that applications can write to directly.
-
CreateEllipticRgn(
int x1, int y1, int x2, int y2) → HRGN gdi32 - Creates an elliptical region.
-
CreateFont(
int cHeight, int cWidth, int cEscapement, int cOrientation, int cWeight, int bItalic, int bUnderline, int bStrikeOut, FONT_CHARSET iCharSet, FONT_OUTPUT_PRECISION iOutPrecision, FONT_CLIP_PRECISION iClipPrecision, FONT_QUALITY iQuality, int iPitchAndFamily, PCWSTR? pszFaceName) → HFONT gdi32 - Creates a logical font with the specified characteristics.
-
CreateFontIndirect(
Pointer< gdi32LOGFONT> lplf) → HFONT - Creates a logical font that has the specified characteristics.
-
CreateHalftonePalette(
HDC? hdc) → HPALETTE gdi32 - Creates a halftone palette for the specified device context (DC).
-
CreateHatchBrush(
HATCH_BRUSH_STYLE iHatch, COLORREF color) → HBRUSH gdi32 - Creates a logical brush that has the specified hatch pattern and color.
-
CreatePen(
PEN_STYLE iStyle, int cWidth, COLORREF color) → HPEN gdi32 - Creates a logical pen that has the specified style, width, and color.
-
CreateRectRgn(
int x1, int y1, int x2, int y2) → HRGN gdi32 - Creates a rectangular region.
-
CreateSolidBrush(
COLORREF color) → HBRUSH gdi32 - Creates a logical brush that has the specified solid color.
-
DeleteDC(
HDC hdc) → bool gdi32 - Deletes the specified device context (DC).
-
DeleteMetaFile(
HMETAFILE hmf) → bool gdi32 - Deletes a Windows-format metafile or Windows-format metafile handle.
-
DeleteObject(
HGDIOBJ ho) → bool gdi32 - Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.
-
DrawEscape(
HDC hdc, int iEscape, int cjIn, PCSTR? lpIn) → int gdi32 - Provides drawing capabilities of the specified video display that are not directly available through the graphics device interface (GDI).
-
Ellipse(
HDC hdc, int left, int top, int right, int bottom) → bool gdi32 - Creates a D2D1_ELLIPSE structure.
-
EndPath(
HDC hdc) → bool gdi32 - Closes a path bracket and selects the path defined by the bracket into the specified device context.
-
EnumFontFamiliesEx(
HDC hdc, Pointer< gdi32LOGFONT> lpLogfont, Pointer<NativeFunction< lpProc, LPARAM lParam, int dwFlags) → intFONTENUMPROC> > - Enumerates all uniquely-named fonts in the system that match the font characteristics specified by the LOGFONT structure.
-
ExtCreatePen(
PEN_STYLE iPenStyle, int cWidth, Pointer< gdi32LOGBRUSH> plbrush, int cStyle, Pointer<Uint32> ? pstyle) → HPEN - Creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes.
-
ExtTextOut(
HDC hdc, int x, int y, ETO_OPTIONS options, Pointer< gdi32RECT> ? lprect, PCWSTR? lpString, int c, Pointer<Int32> ? lpDx) → bool - Draws text using the currently selected font, background color, and text color.
-
FillPath(
HDC hdc) → bool gdi32 - Closes any open figures in the current path and fills the path's interior by using the current brush and polygon-filling mode.
-
FlattenPath(
HDC hdc) → bool gdi32 - Transforms any curves in the path that is selected into the current device context (DC), turning each curve into a sequence of lines.
-
GetDeviceCaps(
HDC? hdc, GET_DEVICE_CAPS_INDEX index) → int gdi32 - Retrieves device-specific information for the specified device.
-
GetDIBits(
HDC hdc, HBITMAP hbm, int start, int cLines, Pointer< gdi32NativeType> ? lpvBits, Pointer<BITMAPINFO> lpbmi, DIB_USAGE usage) → int - Retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
-
GetNearestColor(
HDC hdc, COLORREF color) → COLORREF gdi32 - Retrieves a color value identifying a color from the system palette that will be displayed when the specified color value is used.
-
GetObject(
HGDIOBJ h, int c, Pointer< gdi32NativeType> ? pv) → int - Retrieves information for the specified graphics object.
-
GetPath(
HDC hdc, Pointer< gdi32POINT> ? apt, Pointer<Uint8> ? aj, int cpt) → int - Retrieves the coordinates defining the endpoints of lines and the control points of curves found in the path that is selected into the specified device context.
-
GetPixel(
HDC hdc, int x, int y) → COLORREF gdi32 - Retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.
-
GetStockObject(
GET_STOCK_OBJECT_FLAGS i) → HGDIOBJ gdi32 - Retrieves a handle to one of the stock pens, brushes, fonts, or palettes.
-
GetTextMetrics(
HDC hdc, Pointer< gdi32TEXTMETRIC> lptm) → bool - Fills the specified buffer with the metrics for the currently selected font.
-
GetWindowExtEx(
HDC hdc, Pointer< gdi32SIZE> lpsize) → bool - This function retrieves the x-extent and y-extent of the window for the specified device context.
-
GetWindowOrgEx(
HDC hdc, Pointer< gdi32POINT> lppoint) → bool - Retrieves the x-coordinates and y-coordinates of the window origin for the specified device context.
-
LineTo(
HDC hdc, int x, int y) → bool gdi32 - Draws a line from the current position up to, but not including, the specified point.
-
MoveToEx(
HDC hdc, int x, int y, Pointer< gdi32POINT> ? lppt) → bool - Updates the current position to the specified point and optionally returns the previous position.
-
Pie(
HDC hdc, int left, int top, int right, int bottom, int xr1, int yr1, int xr2, int yr2) → bool gdi32 - Draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials.
-
PolyBezier(
HDC hdc, Pointer< gdi32POINT> apt, int cpt) → bool - Draws one or more Bézier curves.
-
PolyBezierTo(
HDC hdc, Pointer< gdi32POINT> apt, int cpt) → bool - Draws one or more Bézier curves.
-
PolyDraw(
HDC hdc, Pointer< gdi32POINT> apt, Pointer<Uint8> aj, int cpt) → bool - Draws a set of line segments and Bézier curves.
-
Polygon(
HDC hdc, Pointer< gdi32POINT> apt, int cpt) → bool - Draws a polygon consisting of two or more vertices connected by straight lines.
-
Polyline(
HDC hdc, Pointer< gdi32POINT> apt, int cpt) → bool - Draws a series of line segments by connecting the points in the specified array.
-
PolylineTo(
HDC hdc, Pointer< gdi32POINT> apt, int cpt) → bool - Draws one or more straight lines.
-
PolyPolygon(
HDC hdc, Pointer< gdi32POINT> apt, Pointer<Int32> asz, int csz) → bool - Draws a series of closed polygons.
-
PolyPolyline(
HDC hdc, Pointer< gdi32POINT> apt, Pointer<Uint32> asz, int csz) → bool - Draws multiple series of connected line segments.
-
PtInRegion(
HRGN hrgn, int x, int y) → bool gdi32 - Determines whether the specified point is inside the specified region.
-
Rectangle(
HDC hdc, int left, int top, int right, int bottom) → bool gdi32 - Draws a rectangle.
-
RectInRegion(
HRGN hrgn, Pointer< gdi32RECT> lprect) → bool - Determines whether any part of the specified rectangle is within the boundaries of a region.
-
RoundRect(
HDC hdc, int left, int top, int right, int bottom, int width, int height) → bool gdi32 - Draws a rectangle with rounded corners.
-
SaveDC(
HDC hdc) → int gdi32 - Saves the current state of the specified device context (DC) by copying data describing selected objects and graphic modes (such as the bitmap, brush, palette, font, pen, region, drawing mode, and mapping mode) to a context stack.
-
SelectClipPath(
HDC hdc, RGN_COMBINE_MODE mode) → bool gdi32 - Selects the current path as a clipping region for a device context, combining the new region with any existing clipping region using the specified mode.
-
SelectObject(
HDC hdc, HGDIOBJ h) → HGDIOBJ gdi32 - Selects an object into the specified device context (DC).
-
SetBkColor(
HDC hdc, COLORREF color) → COLORREF gdi32 - 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(
HDC hdc, BACKGROUND_MODE mode) → int gdi32 - Sets the background mix mode of the specified device context.
-
SetMapMode(
HDC hdc, HDC_MAP_MODE iMode) → int gdi32 - Sets the mapping mode of the specified device context.
-
SetPixel(
HDC hdc, int x, int y, COLORREF color) → COLORREF gdi32 - Sets the pixel at the specified coordinates to the specified color.
-
SetStretchBltMode(
HDC hdc, STRETCH_BLT_MODE mode) → int gdi32 - Sets the bitmap stretching mode in the specified device context.
-
SetTextColor(
HDC hdc, COLORREF color) → COLORREF gdi32 - Sets the text color for the specified device context to the specified color.
-
SetViewportExtEx(
HDC hdc, int x, int y, Pointer< gdi32SIZE> ? lpsz) → bool - Sets the horizontal and vertical extents of the viewport for a device context by using the specified values.
-
SetViewportOrgEx(
HDC hdc, int x, int y, Pointer< gdi32POINT> ? lppt) → bool - Specifies which device point maps to the window origin (0,0).
-
SetWindowExtEx(
HDC hdc, int x, int y, Pointer< gdi32SIZE> ? lpsz) → bool - Sets the horizontal and vertical extents of the window for a device context by using the specified values.
-
StretchBlt(
HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC? hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, ROP_CODE rop) → bool gdi32 - Copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary.
-
StretchDIBits(
HDC hdc, int xDest, int yDest, int destWidth, int destHeight, int xSrc, int ySrc, int srcWidth, int srcHeight, Pointer< gdi32NativeType> ? lpBits, Pointer<BITMAPINFO> lpbmi, DIB_USAGE iUsage, ROP_CODE rop) → int - Copies the color data for a rectangle of pixels in a DIB, JPEG, or PNG image to the specified destination rectangle.
-
StrokeAndFillPath(
HDC hdc) → bool gdi32 - Closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush.
-
StrokePath(
HDC hdc) → bool gdi32 - Renders the specified path by using the current pen.
-
TextOut(
HDC hdc, int x, int y, PCWSTR lpString, int c) → bool gdi32 - Writes a character string at the specified location, using the currently selected font, background color, and text color.
-
WidenPath(
HDC hdc) → bool gdi32 - Redefines the current path as the area that would be painted if the path were stroked using the pen currently selected into the given device context.