WinAPY Documentation




AngleArc

1
2
def AngleArc(hdc: HDC, x: int, y: int, r: int, StartAngle: float, SweepAngle: float) -> bool:
...

Description

Draws a line segment and an arc.

Parameters

hdc HDC
Handle to the device context

x int
X coordinate of the center of the circle

y int
Y coordinate of the center of the circle

r int
The radius of the circle

StartAngle float
The start angle in degrees, relative to the x-axis

SweepAngle float
The sweep angle in degrees, relative to the starting angle


Arc

1
2
def Arc(hdc: HDC, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, x4: int, y4: int) -> bool:
...

Description

Draws an elliptical arc.

Parameters

hdc HDC
Handle to the device context

x1 int
X coordinate of the upper-left corner of the bounding rectangle

y1 int
Y coordinate of the upper-left corner of the bounding rectangle

x2 int
X coordinate of the lower-right corner of the bounding rectangle

y2 int
Y coordinate of the lower-right corner of the bounding rectangle

x3 int
X coordinate of the ending point of the radial line defining the starting point of the arc.

y3 int
Y coordinate of the ending point of the radial line defining the starting point of the arc.

x4 int
X coordinate of the ending point of the radial line defining the ending point of the arc.

y4 int
Y coordinate of the ending point of the radial line defining the ending point of the arc.


ArcTo

1
2
def ArcTo(hdc: HDC, left: int, top: int, right: int, bottom: int, xr1: int, yr1: int, xr2: int, yr2: int) -> bool:
...

Description

Draws an elliptical arc.

Parameters

hdc HDC
Handle to the device context

left int
X coordinate of the upper-left corner of the bounding rectangle

top int
Y coordinate of the upper-left corner of the bounding rectangle

right int
X coordinate of the lower-right corner of the bounding rectangle

bottom int
Y coordinate of the lower-right corner of the bounding rectangle

xr1 int
X coordinate of the endpoint of the radial defining the starting point of the arc

yr1 int
Y coordinate of the endpoint of the radial defining the starting point of the arc

xr2 int
X coordinate of the endpoint of the radial defining the ending point of the arc

yr2 int
Y coordinate of the endpoint of the radial defining the ending point of the arc


BeginPath

1
2
def BeginPath(hdc: HDC) -> bool:
...

Description

Opens a path bracket in the specified device context.

Parameters

hdc HDC
Handle to a device context


BitBlt

1
2
def BitBlt(HDC: hdcDst, int: x, int: y, int: cx, int: cy, HDC: hdcSrc, int: x1, int: y1, int: rop) -> bool:
...

Description

Bit-block transfer of the color data from a rectangle of pixels from hdcSrc into hdcDst using the specified raster operation.

Parameters

HDC hdcDst
Handle to the destination device context

int x
Rectangles left offset

int y
Rectangles top offset

int cx
Rectangles right offset

int cy
Rectangles bottom offset

HDC hdcSrc
Handle to the source device context

int x1
Source device context's rectangles left

int y1
Source device context's rectangles top

int rop
The raster operation code


CancelDC

1
2
def CancelDC(hdc: HDC) -> bool:
...

Description

Cancels any pending operation on the specified device context.

Parameters

hdc HDC
A handle to a device context


Chord

1
2
def Chord(hdc: HDC, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, x4: int, y4: int) -> bool:
...

Description

Draws a chord outlined by using the current pen and filled by using the current brush.

Parameters

hdc HDC
Handle to the device context

x1 int
X coordinate of the upper-left corner of the bounding rectangle

y1 int
Y coordinate of the upper-left corner of the bounding rectangle

x2 int
X coordinate of the lower-right corner of the bounding rectangle

y2 int
Y coordinate of the lower-right corner of the bounding rectangle

x3 int
X coordinate of the endpoint of the radial defining the beginning of the chord

y3 int
Y coordinate of the endpoint of the radial defining the beginning of the chord

x4 int
X coordinate of the endpoint of the radial defining the end of the chord

y4 int
Y coordinate of the endpoint of the radial defining the end of the chord


CreateCompatibleBitmap

1
2
def CreateCompatibleBitmap(hdc: HDC, cx: int, cy: int) -> HBITMAP:
...

Description

Returns a bitmap compatible with the device that is associated with the specified device context.

Parameters

hdc HDC
A handle to a device context

cx int
The bitmap width, in pixels

cy int
The bitmap height, in pixels


CreateCompatibleDC

1
2
def CreateCompatibleDC(hdc: HDC) -> HDC:
...

Description

Creates a memory device context compatible with the specified device.

Parameters

hdc HDC
Handle to the device context, or None


CreateDIBSection

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CreateDIBSection on Microsoft Docs

1
2
def CreateDIBSection(hdc: HDC):
...

CreateEllipticRgn

1
2
def CreateEllipticRgn(x1: int, y1: int, x2: int, y2: int) -> HRGN:
...

Description

Creates an elliptical region.

Parameters

x1 int
X coordinate of the upper-left corner of the bounding rectangle of the ellipse

y1 int
Y coordinate of the upper-left corner of the bounding rectangle of the ellipse

x2 int
X coordinate of the lower-right corner of the bounding rectangle of the ellipse

y2 int
Y coordinate of the lower-right corner of the bounding rectangle of the ellipse


CreateEllipticRgnIndirect

1
2
def CreateEllipticRgnIndirect(rgnTuple: tuple) -> HRGN:
...

Description

Creates an elliptical region from a tuple.

Parameters

rgnTuple tuple
A tuple of 4 integers containing the X coordinate of the upper-left corner of the bounding rectangle of the ellipse, Y coordinate of the upper-left corner of the bounding rectangle of the ellipse, X coordinate of the lower-right corner of the bounding rectangle of the ellipse and Y coordinate of the lower-right corner of the bounding rectangle of the ellipse.


CreateHatchBrush

1
2
def CreateHatchBrush(iHatch: int, color: int) -> HBRUSH:
...

Description

Creates a logical brush that has the specified hatch pattern and color.

Parameters

iHatch int
The hatch style of the brush.

color int
The foreground color of the brush that is used for the hatches. To create a color value, use the RGB function.


CreatePen

1
2
def CreatePen(iStyle: int, cWidth: int, color: int) -> HPEN:
...

Description

Creates a logical pen that has the specified style, width, and color.

Parameters

iStyle int
The pen style. It can be any one of the following values; ``PS_SOLID, PS_DASH, PS_DOT, PS_DASHDOT, PS_DASHDOTDOT, PS_NULL or PS_INSIDEFRAME``

cWidth int
The width of the pen

color int
The color of the pen, commonly returned from the RGB function


CreatePenIndirect

1
2
def CreatePenIndirect(penProperties: tuple) -> HPEN:
...

Description

Creates a logical pen that has the specified style, width, and color from a tuple.

Parameters

penProperties tuple
The touple should contain the pen style, the width of the pen as a tuple of two integers, and the color of the pen.


CreatePolygonRgn

1
2
def CreatePolygonRgn(points: tuple, mode: int) -> HRGN:
...

Description

Creates a polygon region using the specified vertices.

Parameters

points tuple
Tuple of coordinates to be made into a polygon, example ((100, 100), (200, 100), (150, 200)) for a triangle

mode int
ALTERNATE or WINDING


CreateRectRgn

1
2
def CreateRectRgn(x1: int, y1: int, x2: int, y2: int) -> HRGN:
...

Description

Creates a rectangular region.

Parameters

x1 int
X coordinate of the upper-left corner of the bounding rectangle of the rectangle

y1 int
Y coordinate of the upper-left corner of the bounding rectangle of the rectangle

x2 int
X coordinate of the lower-right corner of the bounding rectangle of the rectangle

y2 int
Y coordinate of the lower-right corner of the bounding rectangle of the rectangle.


CreateRectRgnIndirect

1
2
def CreateRectRgnIndirect(rgnTuple: tuple) -> HRGN:
...

Description

Creates a rectangular region from a tuple.

Parameters

rgnTuple tuple
A tuple of 4 integers containing the X coordinate of the upper-left corner of the bounding rectangle of the rectangle, Y coordinate of the upper-left corner of the bounding rectangle of the rectangle, X coordinate of the lower-right corner of the bounding rectangle of the rectangle and Y coordinate of the lower-right corner of the bounding rectangle of the rectangle.


CreateRoundRectRgn

1
2
def CreateRoundRectRgn(x1: int, y1: int, x2: int, y2: int, w: int, h: int) -> HRGN:
...

Description

Creates a rounded rectangular region.

Parameters

x1 int
X coordinate of the upper-left rectangle.

y1 int
Y coordinate of the upper-left rectangle.

x2 int
X coordinate of the down-right rectangle.

y2 int
Y coordinate of the down-right rectangle.

w int
Horizontal strength of the roundness.

h int
Vertical strength of the roundness.


CreateSolidBrush

1
2
def CreateSolidBrush(color: int) -> HBRUSH:
...

Description

Creates a new HBRUSH with the specified color.

Parameters

color int
The color of the brush


DeleteDC

1
2
def DeleteDC(HDC: hdc) -> bool:
...

Description

Frees up memory allocated by the specified device context and closes its handle.

Parameters

HDC hdc
Handle to a device context to deallocate and close.


DeleteObject

1
2
def DeleteObject(object: HGDIOBJ) -> bool:
...

Description

Deletes the object and frees its memory.

Parameters

object HGDIOBJ
The object to delete, can be a brush, a pen etc.


Ellipse

1
2
def Ellipse(left: int, top: int, right: int, bottom: int) -> bool:
...

Description

Draws an ellipse using the current brush on the specified device context.

Parameters

left int
Left offset of ellipse

top int
Top offset of ellipse

right int
Right offset of ellipse

bottom int
Bottom offset of ellipse


EndPath

1
2
def EndPath(hdc: HDC) -> bool:
...

Description

Closes a path bracket and selects the path defined by the bracket into the specified device context.

Parameters

hdc HDC
Handle to a device context


EqualRgn

1
2
def EqualRgn(rgn1: HRGN, rgn2: HRGN) -> bool:
...

Description

Checks whether two regions are equal to each other.

Parameters

rgn1 HRGN
The first region to be compared

rgn2 HRGN
The second region to be compared


ExtCreatePen

1
2
def ExtCreatePen(style: int, cWidth: int, logBrush: tuple, pstyle: tuple) -> HPEN:
...

Description

Creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes.

Parameters

style int
The type can be ``PS_GEOMETRIC or PS_COSMETIC``, combine it with the OR operator with the style that can be any of the following values; ``PS_ALTERNATE, PS_SOLID, PS_DASH, PS_DOT, PS_DASHDOT, PS_DASHDOTDOT, PS_NULL, PS_USERSTYLE, PS_INSIDEFRAME``, combine it with the OR operator if the pen type is geometric with any of the following values (end cap); ``PS_ENDCAP_ROUND, PS_ENDCAP_SQUARE, PS_ENDCAP_FLAT``, if it is geometrical you should also combine it with the OR operator with any of the following values (join); ``PS_JOIN_BEVEL, PS_JOIN_MITER, PS_JOIN_ROUND``.

cWidth int
The width of the pen. If the pen type is ``PS_COSMETIC`` it should be set to 1.

logBrush tuple
Tuple containing 3 elements; style, color and a hatch brush.

pstyle tuple
Tuple of maximum 16 ints that specifies an user-defined style, or None.


FillRgn

1
2
def FillRgn(hdc: HDC, rgn: HRGN, brush: HBRUSH) -> bool:
...

Description

Fills the specified region using the given brush.

Parameters

hdc HDC
Handle to a device context

rgn HRGN
Region to be filled

brush HBRUSH
Brush to paint the region with


FlattenPath

1
2
def FlattenPath(hdc: HDC) -> bool:
...

Description

Transforms any curves in the path that is selected into the current device context, turning curves into sequences of lines.

Parameters

hdc HDC
Handle to a device context


FrameRgn

1
2
def FrameRgn(hdc: HDC, rgn: HRGN, hbr: HBRUSH, w: int, h: int) -> bool:
...

Description

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

Parameters

hdc HDC
Handle to a device context

rgn HRGN
Handle to a region to be drawn a border around it

hbr HBRUSH
Brush to paint the border with

w int
Width of vertical brush strokes.

h int
Height of horizontal brush strokes.


GdiGetBatchLimit

1
2
def GdiGetBatchLimit() -> int:
...

Description

Returns the maximum number of function calls that can be accumulated in the calling thread's current batch.


GdiSetBatchLimit

1
2
def GdiSetBatchLimit(val: int) -> int:
...

Description

Sets the maximum number of function calls that can be accumulated in the calling thread's current batch.

Parameters

val int
The number of maxiumum number of function calls that can be accumulated in the calling thread's current batch


GetArcDirection

1
2
def GetArcDirection(hdc: HDC) -> int:
...

Description

Returns the current arc direction for the specified device context.

Parameters

hdc HDC
Handle to a device context


GetBValue

1
2
def GetBValue(color: int) -> int:
...

Description

Get the B value from the specified color.

Parameters

color int
Color to retrieve the B value from


GetBkColor

1
2
def GetBkColor(hdc: HDC) -> int:
...

Description

Returns the current background mix mode for a specified device context.

Parameters

hdc HDC
Handle to a device context


GetBkMode

1
2
def GetBkMode(hdc: HDC) -> int:
...

Description

Returns the current background mix mode for a specified device context.

Parameters

hdc HDC
Handle to a device context


GetDCBrushColor

1
2
def GetDCBrushColor(hdc: HDC) -> int:
...

Description

Returns the current brush color for the specified device context.

Parameters

hdc HDC
Handle to the device context


GetDCOrgEx

1
2
def GetDCOrgEx(hdc: HDC) -> (int, int):
...

Description

Returns the final translation origin for a specified device context as a point.

Parameters

hdc HDC
Handle to the device context


GetDCPenColor

1
2
def GetDCPenColor(hdc: HDC) -> int:
...

Description

Returns the current pen color for the specified device context.

Parameters

hdc HDC
Handle to the device context


GetDeviceCaps

1
2
def GetDeviceCaps(hdc: HDC, index: int) -> int:
...

Description

Returns device-specific information for the specified device context.

Parameters

hdc HDC
Handle to the device context

index int
The item to be returned


GetGValue

1
2
def GetGValue(color: int) -> int:
...

Description

Get the G value from the specified color.

Parameters

color int
Color to retrieve the G value from


GetLastError

1
2
def GetLastError() -> int:
...

Description

Retrieves the last error code caused by a WinAPY function.


GetObjectType

1
2
def GetObjectType(h: int) -> int:
...

Description

Retrieves the type of the specified object.

Parameters

h int
Handle to the object


GetPixel

1
2
def GetPixel(hdc: HDC, x: int, y: int) -> int:
...

Description

Gets the specified pixel's color on a device context.

Parameters

hdc HDC
The device context to retrieve the pixel of.

x int
The x coordinate of the pixel

y int
The y coordinate of the pixel


GetRGBValues

1
2
def GetRGBValues(color: int) -> tuple:
...

Description

Returns the RGB values of a color, as a tuple of three integers.

Parameters

color int
Color to retrieve the RGB values from


GetRValue

1
2
def GetRValue(color: int) -> int:
...

Description

Get the R value from the specified color.

Parameters

color int
Color to retrieve the R value from


GetStockObject

1
2
def GetStockObject(i: int) -> HGDIOBJ:
...

Description

Returns a handle to one of the stock pens, brushes, fonts, or palettes.

Parameters

i int
The type of stock object to be retrieved.


GetStretchBltMode

1
2
def GetStretchBltMode(hdc: HDC) -> int:
...

Description

Gets the current stretching mode of the specified device context.

Parameters

hdc HDC
The device context to retrieve the stretching mode of


GetTextAlign

1
2
def GetTextAlign(hdc: HDC) -> int:
...

Description

Returns the text-alignment setting for the specified device context.

Parameters

hdc HDC
Handle to a device context


GetTextColor

1
2
def GetTextColor(hdc: HDC) -> int:
...

Description

Returns the text color for the specified device context.

Parameters

hdc HDC
Handle to a device context


GetWorldTransform

1
2
def GetWorldTransform(hdc: HDC) -> (float, float, float, float, float, float):
...

Description

Returns the current world-space to page-space transformation.

Parameters

hdc HDC
Handle to a device context


InvertRgn

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View InvertRgn on Microsoft Docs

1
2
def InvertRgn(hdc: int, hrgn: int) -> O:
...

LineTo

1
2
def LineTo(hdc: HDC, x: int, y: int) -> bool:
...

Description

Draws a line from the current position up to, but not including, the specified point.

Parameters

hdc HDC
Handle to a device context

x int
X-coordinate of the line

y int
Y-coordinate of the line


MaskBlt

1
2
def MaskBlt(hdcDest: hdc, xDest: int, yDest: int, width: int, height: int, hdcSrc: hdc, xSrc: int, ySrc: int, hbmMask: HBITMAP, xMask: int, yMask: int) -> bool:
...

Description

Combines the color data for the source and destination bitmaps using the specified mask and raster operation.

Parameters

hdcDest hdc
Handle to the destination device context.

xDest int
The x-coordinate, in logical units, of the upper-left corner of the source rectangle.

yDest int
The y-coordinate, in logical units, of the upper-left corner of the source rectangle.

width int
The width, in logical units, of the source rectangle.

height int
The height, in logical units, of the source rectangle.

hdcSrc hdc
Handle to the source device context.

xSrc int
The x-coordinate, in logical units, of the upper-left corner of the source bitmap.

ySrc int
The y-coordinate, in logical units, of the upper-left corner of the source bitmap.

hbmMask HBITMAP
A handle to a monochrome bitmap that is used to mask the colors of the source rectangle.

xMask int
The x-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.

yMask int
The y-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.


PaintRgn

1
2
def PaintRgn(hdc: HDC, rgn: HRGN) -> bool:
...

Description

Paints the specified region by using the brush currently selected into the device context.

Parameters

hdc HDC
Handle to a device context

rgn HRGN
Region to be painted


PatBlt

1
2
def PatBlt(HDC: hdc, int: x, int: y, int: w, int: h, int: rop) -> bool:
...

Description

Paints a rectangle on the specified device context by mixing the current brush with existing colors according to the rop argument.

Parameters

HDC hdc
Handle to the device context

int x
Rectangles left offset

int y
Rectangles top offset

int w
Rectangles right offset

int h
Rectangles bottom offset

int rop
The raster operation code


PathToRegion

1
2
def PathToRegion(hdc: HDC) -> HRGN:
...

Description

Creates a region from the path that is selected into the specified device context.

Parameters

hdc HDC
Handle to a device context


Pie

1
2
def Pie(hdc: HDC, left: int, top: int, right: int, bottom: int, xr1: int, yr1: int, xr2: int, yr2: int) -> bool:
...

Description

Draws 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.

Parameters

hdc HDC
Handle to the device context

left int
X coordinate of the upper-left corner of the bounding rectangle

top int
Y coordinate of the upper-left corner of the bounding rectangle

right int
X coordinate of the lower-right corner of the bounding rectangle

bottom int
Y coordinate of the lower-right corner of the bounding rectangle

xr1 int
X-coordinate of the endpoint of the first radial

yr1 int
Y-coordinate of the endpoint of the first radial

xr2 int
X-coordinate of the endpoint of the second radial

yr2 int
Y-coordinate of the endpoint of the second radial


PlgBlt

1
2
def PlgBlt(hdcDst: hdc, points: tuple, hdcSrc: hdc, xSrc: int, ySrc: int, width: int, height: int, bitmap: HBITMAP, xMask: int, yMask: int) -> bool:
...

Description

Performs a bit-block transfer of the bits of color data from the specified rectangle in the source device context to the specified parallelogram in the destination device context. If the given bitmask handle identifies a valid monochrome bitmap, the function uses this bitmap to mask the bits of color data from the source rectangle.

Parameters

hdcDst hdc
Handle to the destination device context.

points tuple
Tuple of three tuples of two ints that identify the parallelogram. Example ``((-10, 10), (20, 0), (10, -10))``.

hdcSrc hdc
Handle to the source device context.

xSrc int
The x-coordinate, in logical units, of the upper-left corner of the source rectangle.

ySrc int
The y-coordinate, in logical units, of the upper-left corner of the source rectangle.

width int
The width, in logical units, of the source rectangle.

height int
The height, in logical units, of the source rectangle.

bitmap HBITMAP
None or a handle to a monochrome bitmap that is used to mask the colors of the source rectangle.

xMask int
The x-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.

yMask int
The y-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.


RGB

1
2
def RGB(r: int, g: int, b: int) -> int:
...

Description

Converts the specified RGB color to an integer passable to WinAPY functions.

Parameters

r int
The R Value

g int
The G value

b int
The B value


Rectangle

1
2
def Rectangle(left: int, top: int, right: int, bottom: int) -> bool:
...

Description

Draws a rectangle using the current brush on the specified device context.

Parameters

left int
Left offset of rectangle

top int
Top offset of rectangle

right int
Right offset of rectangle

bottom int
Bottom offset of rectangle


RestoreDC

1
2
def RestoreDC(hdc: HDC, nSavedDC: int) -> bool:
...

Description

Restores a device context to the specified state returned from the SaveDC function.

Parameters

hdc HDC
Handle to the device context

nSavedDC int
The state to be restored


RoundRect

1
2
def RoundRect(hdc: HDC, x1: int, y1: int, x2: int, y2: int, w: int, h: int) -> bool:
...

Description

Draws a rectangle with rounded corners.

Parameters

hdc HDC
Handle to a device context.

x1 int
X coordinate of the upper-left rectangle.

y1 int
Y coordinate of the upper-left rectangle.

x2 int
X coordinate of the down-right rectangle.

y2 int
Y coordinate of the down-right rectangle.

w int
Horizontal strength of the roundness.

h int
Vertical strength of the roundness.


SaveDC

1
2
def SaveDC(hdc: HDC) -> int:
...

Description

Saves the current state of the specified device context.

Parameters

hdc HDC
Handle to the device context


SelectClipPath

1
2
def SelectClipPath(hdc: HDC, mode: int) -> bool:
...

Description

Selects the current path as a clipping region for a device context, merging the new region with any existing clipping region using the specified mode.

Parameters

hdc HDC
Handle to a device context

mode int
RGN_AND, RGN_COPY, RGN_DIFF, RGN_OR or RGN_XOR


SelectClipRgn

1
2
def SelectClipRgn(hdc: HDC, hrgn: HRGN) -> int:
...

Description

Selects a region as the current clipping region for the specified device context.

Parameters

hdc HDC
A handle to a device context

hrgn HRGN
A handle to a region


SelectObject

1
2
def SelectObject(object: int) -> int:
...

Description

Sets the specified device context's current object of that objects type the specified object.

Parameters

object int
Handle to the object to select


SelectPalette

1
2
def SelectPalette(hdc: HDC, hPal: HPALLETE, forceBkgd: bool) -> HPALLETE:
...

Description

Selects the specified logical palette into a device context.

Parameters

hdc HDC
Handle to a device context

hPal HPALLETE
Handle to the logical palette to be selected

forceBkgd bool
[Optional] Specifies whether the logical palette is forced to be a background palette


SetArcDirection

1
2
def SetArcDirection(hdc: HDC, dir: int) -> int:
...

Description

Sets the drawing direction to be used for arc and rectangle functions.

Parameters

hdc HDC
Handle to the device context

dir int
AD_COUNTERCLOCKWISE (Figures drawn counterclockwise) or AD_CLOCKWISE (Figures drawn clockwise)


SetBkColor

1
2
def SetBkColor(hdc: HDC, mode: int) -> bool:
...

Description

Sets the background mix mode of the specified device context.

Parameters

hdc HDC
Handle to a device context

mode int
OPAQUE or TRANSPARENT


SetBkMode

1
2
def SetBkMode(hdc: HDC, mode: int) -> bool:
...

Description

Sets the background mix mode of the specified device context.

Parameters

hdc HDC
Handle to a device context

mode int
OPAQUE or TRANSPARENT


SetPixel

1
2
def SetPixel(hdc: HDC, x: int, y: int, color: int) -> int:
...

Description

Sets the specified pixel on a device context.

Parameters

hdc HDC
The device context to change the pixel of.

x int
The x coordinate of the pixel

y int
The y coordinate of the pixel

color int
The new color of the pixel


SetPixelV

1
2
def SetPixelV(hdc: HDC, x: int, y: int, color: int) -> int:
...

Description

Sets the pixel at the specified coordinate to the specified color.

Parameters

hdc HDC
Handle to a device context

x int
The X coordinate of the pixel

y int
The Y coordinate of the pixel

color int
The new color of the pixel


SetPolyFillMode

1
2
def SetPolyFillMode(hdc: HDC, mode: int) -> int:
...

Description

Sets the polygon fill mode for functions that fill polygons

Parameters

hdc HDC
Handle to a device context

mode int
ALTERNATE or WINDING


SetROP2

1
2
def SetROP2(hdc: HDC, rop2: int) -> int:
...

Description

Sets the current foreground mix mode and returns the previous value.

Parameters

hdc HDC
Handle to a device context

rop2 int
The mixing mode


SetStretchBltMode

1
2
def SetStretchBltMode(hdc: HDC, iMode: int) -> int:
...

Description

Sets the bitmap stretching mode in the specified device context.

Parameters

hdc HDC
The device context to change the stretching mode of

iMode int
The new stretching mode


SetTextAlign

1
2
def SetTextAlign(hdc: HDC, align: int) -> int:
...

Description

Sets the text-alignment flags for the specified device context and returns the previous value.

Parameters

hdc HDC
Handle to a device context

align int
The text alignment by using a mask.


SetTextCharacterExtra

1
2
def SetTextCharacterExtra(hdc: HDC, extra: int) -> int:
...

Description

Sets the intercharacter spacing for the specified device context. Returns the previous intercharacter spacing.

Parameters

hdc HDC
Handle to a device context

extra int
The amount of extra space


SetTextColor

1
2
def SetTextColor(hdc: HDC, color: int) -> int:
...

Description

Sets the text color for the specified device context to the specified color.

Parameters

hdc HDC
Handle to a device context

color int
Text color


SetTextJustification

1
2
def SetTextJustification(hdc: HDC, extra: int, count: int) -> bool:
...

Description

Sets the amount of space the system should add to the break characters in a string of text.

Parameters

hdc HDC
Handle to a device context

extra int
The extra space

count int
The number of break characters in the line


StretchBlt

1
2
def StretchBlt(hdcDest: HDC, xDest: int, yDest: int, wDest: int, hDest: int, hdcSrc: HDC, xSrc: int, ySrc: int, wSrc: int, hSrc: int, rop: int) -> bool:
...

Description

Copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle.

Parameters

hdcDest HDC
Handle to destinations device context

xDest int
Left offset of the destinations rectangle

yDest int
Top offset of the destinations rectangle

wDest int
Right offset of the destinations rectangle

hDest int
Bottom offset of the destinations rectangle

hdcSrc HDC
Handle to sources device context

xSrc int
Left offset of the sources rectangle

ySrc int
Top offset of the sources rectangle

wSrc int
Right offset of the sources rectangle

hSrc int
Bottom offset of the sources rectangle

rop int
The raster operation


TextOut

1
2
def TextOut(hdc: HDC, x: int, y: int, string: str) -> bool:
...

Description

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

Parameters

hdc HDC
Handle to a device context

x int
The x-position where the text should be drawn at

y int
The y-position where the text should be drawn at

string str
The text that should be drawn, in UTF-16


TextOutA

1
2
def TextOutA(hdc: HDC, x: int, y: int, string: str) -> bool:
...

Description

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

Parameters

hdc HDC
Handle to a device context

x int
The x-position where the text should be drawn at

y int
The y-position where the text should be drawn at

string str
The text that should be drawn, in ASCII


TextOutW

1
2
def TextOutW(hdc: HDC, x: int, y: int, string: str) -> bool:
...

Description

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

Parameters

hdc HDC
Handle to a device context

x int
The x-position where the text should be drawn at

y int
The y-position where the text should be drawn at

string str
The text that should be drawn, in UTF-16


UnrealizeObject

1
2
def UnrealizeObject(h: HGDIOBJ) -> bool:
...

Description

Resets the origin of a brush or resets a palette.

Parameters

h HGDIOBJ
Handle to an object to be reset


UpdateColors

1
2
def UpdateColors(hdc: HDC) -> bool:
...

Description

Updates the client area of the specified device context by remapping the current colors in the client area to the currently realized logical palette.

Parameters

hdc HDC
Handle to a device context