Top Description Fields Methods
com.sun.jna.platform.win32

public Interface GDI32

extends StdCallLibrary
Imports
com.sun.jna.Native, .Pointer, com.sun.jna.platform.win32.WinDef.HBITMAP, .WinDef.HBRUSH, .WinDef.HDC, .WinDef.HFONT, .WinDef.HPALETTE, .WinDef.HPEN, .WinDef.HRGN, .WinDef.WORD, .WinGDI.BITMAP, .WinGDI.BITMAPINFO, .WinGDI.BITMAPINFOHEADER, .WinGDI.PIXELFORMATDESCRIPTOR, .WinGDI.RGNDATA, .WinNT.HANDLE, com.sun.jna.ptr.PointerByReference, com.sun.jna.win32.StdCallLibrary, .W32APIOptions

Definition (incomplete) of gdi32.dll.
Author
Andreas "PAX" Lück, onkelpax-git[at]yahoo.de

Field Summary

Modifier and TypeField and Description
public static final GDI32
public static final int
SRCCOPY

Used with BitBlt.

Inherited from com.sun.jna.win32.StdCallLibrary:
FUNCTION_MAPPERSTDCALL_CONVENTION

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if the function succeeded, False if not. To get extended error information, call GetLastError.
BitBlt
(WinDef.HDC
A handle to the destination device context.
hdcDest
,
int
The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nXDest
,
int
The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nYDest
,
int
The width, in logical units, of the source and destination rectangles.
nWidth
,
int
The height, in logical units, of the source and the destination rectangles.
nHeight
,
WinDef.HDC
A handle to the source device context.
hdcSrc
,
int
The x-coordinate, in logical units, of the upper-left corner of the source rectangle.
nXSrc
,
int
The y-coordinate, in logical units, of the upper-left corner of the source rectangle.
nYSrc
,
int
A raster-operation code.
These codes define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color.
The following list shows some common raster operation codes.
Value Meaning
BLACKNESS Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
CAPTUREBLT Includes any windows that are layered on top of your window in the resulting image. By default, the image only contains your window. Note that this generally cannot be used for printing device contexts.
DSTINVERT Inverts the destination rectangle.
MERGECOPY Merges the colors of the source rectangle with the brush currently selected in hdcDest, by using the Boolean AND operator.
MERGEPAINT Merges the colors of the inverted source rectangle with the colors of the destination rectangle by using the Boolean OR operator.
NOMIRRORBITMAP Prevents the bitmap from being mirrored.
NOTSRCCOPY Copies the inverted source rectangle to the destination.
NOTSRCERASE Combines the colors of the source and destination rectangles by using the Boolean OR operator and then inverts the resultant color.
PATCOPY Copies the brush currently selected in hdcDest, into the destination bitmap.
PATINVERT Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator.
PATPAINT Combines the colors of the brush currently selected in hdcDest, with the colors of the inverted source rectangle by using the Boolean OR operator. The result of this operation is combined with the colors of the destination rectangle by using the Boolean OR operator.
SRCAND Combines the colors of the source and destination rectangles by using the Boolean AND operator.
SRCCOPY Copies the source rectangle directly to the destination rectangle.
SRCERASE Combines the inverted colors of the destination rectangle with the colors of the source rectangle by using the Boolean AND operator.
SRCINVERT Combines the colors of the source and destination rectangles by using the Boolean XOR operator.
SRCPAINT Combines the colors of the source and destination rectangles by using the Boolean OR operator.
WHITENESS Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)
dwRop
)

The BitBlt function 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.

public int

Returns:

If the function succeeds, the return value is a pixel format index (one-based) that is the closest match to the given pixel format descriptor.
ChoosePixelFormat
(WinDef.HDC
Specifies the device context that the function examines to determine the best match for the pixel format descriptor pointed to by ppfd.
hdc
,
WinGDI.PIXELFORMATDESCRIPTOR.ByReference
Pointer to a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format.
ppfd
)

The ChoosePixelFormat function attempts to match an appropriate pixel format supported by a device context to a given pixel format specification.

public int

Returns:

The return value specifies the type of the resulting region.
CombineRgn
(WinDef.HRGN
Handle to a new region with dimensions defined by combining two other regions.
hrgnDest
,
WinDef.HRGN
Handle to the first of two regions to be combined.
hrgnSrc1
,
WinDef.HRGN
Handle to the second of two regions to be combined.
hrgnSrc2
,
int
Specifies a mode indicating how the two regions will be combined.
fnCombineMode
)

The CombineRgn function combines two regions and stores the result in a third region.

public WinDef.HBITMAP

Returns:

If the function succeeds, the return value is a handle to the compatible bitmap (DDB). If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CreateCompatibleBitmap
(WinDef.HDC
Handle to a device context.
hDC
,
int
Specifies the bitmap width, in pixels.
width
,
int
Specifies the bitmap height, in pixels.
height
)

The CreateCompatibleBitmap function creates a bitmap compatible with the device that is associated with the specified device context.

public WinDef.HDC

Returns:

If the function succeeds, the return value is the handle to a memory DC. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CreateCompatibleDC
(WinDef.HDC
Handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
hDC
)

The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.

public WinDef.HBITMAP

Returns:

If the function succeeds, the return value is a handle to the compatible bitmap. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CreateDIBitmap
(WinDef.HDC
Handle to a device context.
hDC
,
WinGDI.BITMAPINFOHEADER
Pointer to a bitmap information header structure, which may be one of those shown in the following table.
lpbmih
,
int
Specifies how the system initializes the bitmap bits.
fdwInit
,
Pointer
Pointer to an array of bytes containing the initial bitmap data.
lpbInit
,
WinGDI.BITMAPINFO
Pointer to a BITMAPINFO structure that describes the dimensions and color format of the array pointed to by the lpbInit parameter.
lpbmi
,
int
Specifies whether the bmiColors member of the BITMAPINFO structure was initialized and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or palette indexes. The fuUsage parameter must be one of the following values.
fuUsage
)

The CreateDIBitmap function creates a compatible bitmap (DDB) from a DIB and, optionally, sets the bitmap bits.

public WinDef.HBITMAP

Returns:

Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin.
CreateDIBSection
(WinDef.HDC
Handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.
hDC
,
WinGDI.BITMAPINFO
Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.
pbmi
,
int
Specifies the type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values).
iUsage
,
PointerByReference
Pointer to a variable that receives a pointer to the location of the DIB bit values.
ppvBits
,
Pointer
Handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.
hSection
,
int
Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin.
dwOffset
)

The CreateDIBSection function creates a DIB that applications can write to directly.

public WinDef.HRGN

Returns:

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is zero. To get extended error information, call GetLastError.
CreatePolyPolygonRgn
(WinDef.POINT[]
Pointer to an array of POINT structures that define the vertices of the polygons in logical units. The polygons are specified consecutively. Each polygon is presumed closed and each vertex is specified only once.
lppt
,
int[]
Pointer to an array of integers, each of which specifies the number of points in one of the polygons in the array pointed to by lppt.
lpPolyCounts
,
int
Specifies the total number of integers in the array pointed to by lpPolyCounts.
nCount
,
int
Specifies the fill mode used to determine which pixels are in the region.
fnPolyFillMode
)

The CreatePolyPolygonRgn function creates a region consisting of a series of polygons.

public WinDef.HRGN

Returns:

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CreateRectRgn
(int
Specifies the x-coordinate of the upper-left corner of the region in logical units.
nLeftRect
,
int
Specifies the y-coordinate of the upper-left corner of the region in logical units.
nTopRect
,
int
Specifies the x-coordinate of the lower-right corner of the region in logical units.
nRightRect
,
int
Specifies the y-coordinate of the lower-right corner of the region in logical units.
nBottomRect
)

The CreateRectRgn function creates a rectangular region.

public WinDef.HRGN

Returns:

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
CreateRoundRectRgn
(int
Specifies the x-coordinate of the upper-left corner of the region in logical units.
nLeftRect
,
int
Specifies the y-coordinate of the upper-left corner of the region in logical units.
nTopRect
,
int
Specifies the x-coordinate of the lower-right corner of the region in logical units.
nRightRect
,
int
Specifies the y-coordinate of the lower-right corner of the region in logical units.
nBottomRect
,
int
Specifies the width of the ellipse used to create the rounded corners in logical units.
nWidthEllipse
,
int
Specifies the height of the ellipse used to create the rounded corners in logical units.
nHeightEllipse
)

The CreateRoundRectRgn function creates a rectangular region with rounded corners.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
DeleteDC
(WinDef.HDC
Handle to the device context.
hDC
)

The DeleteDC function deletes the specified device context (DC).

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero. To get extended error information, call GetLastError.
DeleteObject
(WinNT.HANDLE
Handle to a logical pen, brush, font, bitmap, region, or palette.
hObject
)

The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.

public WinDef.HRGN

Returns:

If the function succeeds, the return value is the value of the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
ExtCreateRegion
(Pointer
Pointer to an XFORM structure that defines the transformation to be performed on the region. If this pointer is NULL, the identity transformation is used.
lpXform
,
int
Specifies the number of bytes pointed to by lpRgnData.
nCount
,
WinGDI.RGNDATA
Pointer to a RGNDATA structure that contains the region data in logical units.
lpRgnData
)

The ExtCreateRegion function creates a region from the specified region and transformation data.

public int

Returns:

The return value specifies the value of the desired item. When nIndex is BITSPIXEL and the device has 15bpp or 16bpp, the return value is 16.
GetDeviceCaps
(WinDef.HDC
A handle to the DC.
hdc
,
int
The item to be returned.
nIndex
)

The GetDeviceCaps function retrieves device-specific information for the specified device.

public int

Returns:

status
GetDIBits
(WinDef.HDC
A handle to the device context.
hdc
,
WinDef.HBITMAP
A handle to the bitmap. This must be a compatible bitmap (DDB).
hbmp
,
int
The first scan line to retrieve
uStartScan
,
int
The number of scan lines to retrieve.
cScanLines
,
Pointer
A pointer to a buffer to receive the bitmap data. If this parameter is null, the function passes the dimensions and format of the bitmap to the BITMAPINFO structure pointed to by the lpbi parameter.
lpvBits
,
WinGDI.BITMAPINFO
A pointer to a BITMAPINFO structure that specifies the desired format for the DIB data.
lpbi
,
int
The format of the bmiColors member of the BITMAPINFO structure.
uUsage
)

The GetDIBits function retrieves the bits fo the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.

public int

Returns:

If the function succeeds, and lpvObject is a valid pointer, the return value is the number of bytes stored into the buffer.

If the function succeeds, and lpvObject is NULL, the return value is the number of bytes required to hold the information the function would store into the buffer.

If the function fails, the return value is zero.
GetObject
(final WinNT.HANDLE
A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap, a brush, a font, a palette, a pen, or a device independent bitmap created by calling the CreateDIBSection function.
hgdiobj
,
final int
The number of bytes of information to be written to the buffer.
cbBuffer
,
final Pointer

A pointer to a buffer that receives the information about the specified graphics object.

The following table shows the type of information the buffer receives for each type of graphics object you can specify with hgdiobj.

Information Received
Object type Data written to buffer
HBITMAP BITMAP
HBITMAP returned from a call to CreateDIBSection DIBSECTION, if cbBuffer is set to sizeof(DIBSECTION), or BITMAP, if cbBuffer is set to sizeof (BITMAP).
HPALETTE A WORD count of the number of entries in the logical palette
HPEN returned from a call to ExtCreatePen EXTLOGPEN
HPEN LOGPEN
HBRUSH LOGBRUSH
HFONT LOGFONT
lpvObject
)

Retrieves information for the specified graphics object.

public WinNT.HANDLE

Returns:

If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the REGION values.
SelectObject
(WinDef.HDC
Handle to the DC.
hDC
,
WinNT.HANDLE
Handle to the object to be selected.
hGDIObj
)

The SelectObject function selects an object into the specified device context (DC).

public int

Returns:

If the function succeeds, the return value is the RGB value that the function sets the pixel to. This value may differ from the color specified by crColor; that occurs when an exact match for the specified color cannot be found. If the function fails, the return value is 1. To get extended error information, call GetLastError. This can be the following value.
SetPixel
(WinDef.HDC
Handle to the device context.
hDC
,
int
Specifies the x-coordinate, in logical units, of the point to be set.
x
,
int
Specifies the y-coordinate, in logical units, of the point to be set.
y
,
int
Specifies the color to be used to paint the point. To create a COLORREF color value, use the RGB macro.
crColor
)

The SetPixel function sets the pixel at the specified coordinates to the specified color.

public boolean

Returns:

true if successful
SetPixelFormat
(WinDef.HDC
Specifies the device context whose pixel format the function attempts to set.
hdc
,
int
Index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes.
iPixelFormat
,
WinGDI.PIXELFORMATDESCRIPTOR.ByReference
Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification.
ppfd
)

The SetPixelFormat function sets the pixel format of the specified device context to the format specified by the iPixelFormat index.

public boolean

Returns:

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
SetRectRgn
(WinDef.HRGN
Handle to the region.
hrgn
,
int
Specifies the x-coordinate of the upper-left corner of the rectangular region in logical units.
nLeftRect
,
int
Specifies the y-coordinate of the upper-left corner of the rectangular region in logical units.
nTopRect
,
int
Specifies the x-coordinate of the lower-right corner of the rectangular region in logical units.
nRightRect
,
int
Specifies the y-coordinate of the lower-right corner of the rectangular region in logical units.
nBottomRect
)

The SetRectRgn function converts a region into a rectangular region with the specified coordinates.

Field Detail

INSTANCEback to summary
public static final GDI32 INSTANCE
SRCCOPYback to summary
public static final int SRCCOPY

Used with BitBlt. Copies the source rectangle directly to the destination rectangle.

Method Detail

BitBltback to summary
public boolean BitBlt(WinDef.HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, WinDef.HDC hdcSrc, int nXSrc, int nYSrc, int dwRop)

The BitBlt function 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.

Parameters
hdcDest:WinDef.HDC

A handle to the destination device context.

nXDest:int

The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.

nYDest:int

The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.

nWidth:int

The width, in logical units, of the source and destination rectangles.

nHeight:int

The height, in logical units, of the source and the destination rectangles.

hdcSrc:WinDef.HDC

A handle to the source device context.

nXSrc:int

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

nYSrc:int

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

dwRop:int

A raster-operation code.
These codes define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color.
The following list shows some common raster operation codes.

Value Meaning
BLACKNESS Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
CAPTUREBLT Includes any windows that are layered on top of your window in the resulting image. By default, the image only contains your window. Note that this generally cannot be used for printing device contexts.
DSTINVERT Inverts the destination rectangle.
MERGECOPY Merges the colors of the source rectangle with the brush currently selected in hdcDest, by using the Boolean AND operator.
MERGEPAINT Merges the colors of the inverted source rectangle with the colors of the destination rectangle by using the Boolean OR operator.
NOMIRRORBITMAP Prevents the bitmap from being mirrored.
NOTSRCCOPY Copies the inverted source rectangle to the destination.
NOTSRCERASE Combines the colors of the source and destination rectangles by using the Boolean OR operator and then inverts the resultant color.
PATCOPY Copies the brush currently selected in hdcDest, into the destination bitmap.
PATINVERT Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator.
PATPAINT Combines the colors of the brush currently selected in hdcDest, with the colors of the inverted source rectangle by using the Boolean OR operator. The result of this operation is combined with the colors of the destination rectangle by using the Boolean OR operator.
SRCAND Combines the colors of the source and destination rectangles by using the Boolean AND operator.
SRCCOPY Copies the source rectangle directly to the destination rectangle.
SRCERASE Combines the inverted colors of the destination rectangle with the colors of the source rectangle by using the Boolean AND operator.
SRCINVERT Combines the colors of the source and destination rectangles by using the Boolean XOR operator.
SRCPAINT Combines the colors of the source and destination rectangles by using the Boolean OR operator.
WHITENESS Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)
Returns:boolean

True if the function succeeded, False if not. To get extended error information, call GetLastError.

ChoosePixelFormatback to summary
public int ChoosePixelFormat(WinDef.HDC hdc, WinGDI.PIXELFORMATDESCRIPTOR.ByReference ppfd)

The ChoosePixelFormat function attempts to match an appropriate pixel format supported by a device context to a given pixel format specification.

Parameters
hdc:WinDef.HDC

Specifies the device context that the function examines to determine the best match for the pixel format descriptor pointed to by ppfd.

ppfd:WinGDI.PIXELFORMATDESCRIPTOR.ByReference

Pointer to a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format.

Returns:int

If the function succeeds, the return value is a pixel format index (one-based) that is the closest match to the given pixel format descriptor.

CombineRgnback to summary
public int CombineRgn(WinDef.HRGN hrgnDest, WinDef.HRGN hrgnSrc1, WinDef.HRGN hrgnSrc2, int fnCombineMode)

The CombineRgn function combines two regions and stores the result in a third region. The two regions are combined according to the specified mode.

Parameters
hrgnDest:WinDef.HRGN

Handle to a new region with dimensions defined by combining two other regions.

hrgnSrc1:WinDef.HRGN

Handle to the first of two regions to be combined.

hrgnSrc2:WinDef.HRGN

Handle to the second of two regions to be combined.

fnCombineMode:int

Specifies a mode indicating how the two regions will be combined.

Returns:int

The return value specifies the type of the resulting region.

CreateCompatibleBitmapback to summary
public WinDef.HBITMAP CreateCompatibleBitmap(WinDef.HDC hDC, int width, int height)

The CreateCompatibleBitmap function creates a bitmap compatible with the device that is associated with the specified device context.

Parameters
hDC:WinDef.HDC

Handle to a device context.

width:int

Specifies the bitmap width, in pixels.

height:int

Specifies the bitmap height, in pixels.

Returns:WinDef.HBITMAP

If the function succeeds, the return value is a handle to the compatible bitmap (DDB). If the function fails, the return value is NULL. To get extended error information, call GetLastError.

CreateCompatibleDCback to summary
public WinDef.HDC CreateCompatibleDC(WinDef.HDC hDC)

The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.

Parameters
hDC:WinDef.HDC

Handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the application's current screen.

Returns:WinDef.HDC

If the function succeeds, the return value is the handle to a memory DC. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

CreateDIBitmapback to summary
public WinDef.HBITMAP CreateDIBitmap(WinDef.HDC hDC, WinGDI.BITMAPINFOHEADER lpbmih, int fdwInit, Pointer lpbInit, WinGDI.BITMAPINFO lpbmi, int fuUsage)

The CreateDIBitmap function creates a compatible bitmap (DDB) from a DIB and, optionally, sets the bitmap bits.

Parameters
hDC:WinDef.HDC

Handle to a device context.

lpbmih:WinGDI.BITMAPINFOHEADER

Pointer to a bitmap information header structure, which may be one of those shown in the following table.

fdwInit:int

Specifies how the system initializes the bitmap bits.

lpbInit:Pointer

Pointer to an array of bytes containing the initial bitmap data.

lpbmi:WinGDI.BITMAPINFO

Pointer to a BITMAPINFO structure that describes the dimensions and color format of the array pointed to by the lpbInit parameter.

fuUsage:int

Specifies whether the bmiColors member of the BITMAPINFO structure was initialized and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or palette indexes. The fuUsage parameter must be one of the following values.

Returns:WinDef.HBITMAP

If the function succeeds, the return value is a handle to the compatible bitmap. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

CreateDIBSectionback to summary
public WinDef.HBITMAP CreateDIBSection(WinDef.HDC hDC, WinGDI.BITMAPINFO pbmi, int iUsage, PointerByReference ppvBits, Pointer hSection, int dwOffset)

The CreateDIBSection function creates a DIB that applications can write to directly. The function gives you a pointer to the location of the bitmap bit values. You can supply a handle to a file-mapping object that the function will use to create the bitmap, or you can let the system allocate the memory for the bitmap.

Parameters
hDC:WinDef.HDC

Handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.

pbmi:WinGDI.BITMAPINFO

Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.

iUsage:int

Specifies the type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values).

ppvBits:PointerByReference

Pointer to a variable that receives a pointer to the location of the DIB bit values.

hSection:Pointer

Handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.

dwOffset:int

Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin.

Returns:WinDef.HBITMAP

Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin.

CreatePolyPolygonRgnback to summary
public WinDef.HRGN CreatePolyPolygonRgn(WinDef.POINT[] lppt, int[] lpPolyCounts, int nCount, int fnPolyFillMode)

The CreatePolyPolygonRgn function creates a region consisting of a series of polygons. The polygons can overlap.

Parameters
lppt:WinDef.POINT[]

Pointer to an array of POINT structures that define the vertices of the polygons in logical units. The polygons are specified consecutively. Each polygon is presumed closed and each vertex is specified only once.

lpPolyCounts:int[]

Pointer to an array of integers, each of which specifies the number of points in one of the polygons in the array pointed to by lppt.

nCount:int

Specifies the total number of integers in the array pointed to by lpPolyCounts.

fnPolyFillMode:int

Specifies the fill mode used to determine which pixels are in the region.

Returns:WinDef.HRGN

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is zero. To get extended error information, call GetLastError.

CreateRectRgnback to summary
public WinDef.HRGN CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)

The CreateRectRgn function creates a rectangular region.

Parameters
nLeftRect:int

Specifies the x-coordinate of the upper-left corner of the region in logical units.

nTopRect:int

Specifies the y-coordinate of the upper-left corner of the region in logical units.

nRightRect:int

Specifies the x-coordinate of the lower-right corner of the region in logical units.

nBottomRect:int

Specifies the y-coordinate of the lower-right corner of the region in logical units.

Returns:WinDef.HRGN

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

CreateRoundRectRgnback to summary
public WinDef.HRGN CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse)

The CreateRoundRectRgn function creates a rectangular region with rounded corners.

Parameters
nLeftRect:int

Specifies the x-coordinate of the upper-left corner of the region in logical units.

nTopRect:int

Specifies the y-coordinate of the upper-left corner of the region in logical units.

nRightRect:int

Specifies the x-coordinate of the lower-right corner of the region in logical units.

nBottomRect:int

Specifies the y-coordinate of the lower-right corner of the region in logical units.

nWidthEllipse:int

Specifies the width of the ellipse used to create the rounded corners in logical units.

nHeightEllipse:int

Specifies the height of the ellipse used to create the rounded corners in logical units.

Returns:WinDef.HRGN

If the function succeeds, the return value is the handle to the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

DeleteDCback to summary
public boolean DeleteDC(WinDef.HDC hDC)

The DeleteDC function deletes the specified device context (DC).

Parameters
hDC:WinDef.HDC

Handle to the device context.

Returns:boolean

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

DeleteObjectback to summary
public boolean DeleteObject(WinNT.HANDLE hObject)

The DeleteObject function 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.

Parameters
hObject:WinNT.HANDLE

Handle to a logical pen, brush, font, bitmap, region, or palette.

Returns:boolean

If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero. To get extended error information, call GetLastError.

ExtCreateRegionback to summary
public WinDef.HRGN ExtCreateRegion(Pointer lpXform, int nCount, WinGDI.RGNDATA lpRgnData)

The ExtCreateRegion function creates a region from the specified region and transformation data.

Parameters
lpXform:Pointer

Pointer to an XFORM structure that defines the transformation to be performed on the region. If this pointer is NULL, the identity transformation is used.

nCount:int

Specifies the number of bytes pointed to by lpRgnData.

lpRgnData:WinGDI.RGNDATA

Pointer to a RGNDATA structure that contains the region data in logical units.

Returns:WinDef.HRGN

If the function succeeds, the return value is the value of the region. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

GetDeviceCapsback to summary
public int GetDeviceCaps(WinDef.HDC hdc, int nIndex)

The GetDeviceCaps function retrieves device-specific information for the specified device.

Parameters
hdc:WinDef.HDC

A handle to the DC.

nIndex:int

The item to be returned.

Returns:int

The return value specifies the value of the desired item. When nIndex is BITSPIXEL and the device has 15bpp or 16bpp, the return value is 16.

GetDIBitsback to summary
public int GetDIBits(WinDef.HDC hdc, WinDef.HBITMAP hbmp, int uStartScan, int cScanLines, Pointer lpvBits, WinGDI.BITMAPINFO lpbi, int uUsage)

The GetDIBits function retrieves the bits fo the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.

Parameters
hdc:WinDef.HDC

A handle to the device context.

hbmp:WinDef.HBITMAP

A handle to the bitmap. This must be a compatible bitmap (DDB).

uStartScan:int

The first scan line to retrieve

cScanLines:int

The number of scan lines to retrieve.

lpvBits:Pointer

A pointer to a buffer to receive the bitmap data. If this parameter is null, the function passes the dimensions and format of the bitmap to the BITMAPINFO structure pointed to by the lpbi parameter.

lpbi:WinGDI.BITMAPINFO

A pointer to a BITMAPINFO structure that specifies the desired format for the DIB data.

uUsage:int

The format of the bmiColors member of the BITMAPINFO structure.

Returns:int

status

GetObjectback to summary
public int GetObject(final WinNT.HANDLE hgdiobj, final int cbBuffer, final Pointer lpvObject)

Retrieves information for the specified graphics object.

Parameters
hgdiobj:WinNT.HANDLE

A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap, a brush, a font, a palette, a pen, or a device independent bitmap created by calling the CreateDIBSection function.

cbBuffer:int

The number of bytes of information to be written to the buffer.

lpvObject:Pointer

A pointer to a buffer that receives the information about the specified graphics object.

The following table shows the type of information the buffer receives for each type of graphics object you can specify with hgdiobj.

Information Received
Object type Data written to buffer
HBITMAP BITMAP
HBITMAP returned from a call to CreateDIBSection DIBSECTION, if cbBuffer is set to sizeof(DIBSECTION), or BITMAP, if cbBuffer is set to sizeof (BITMAP).
HPALETTE A WORD count of the number of entries in the logical palette
HPEN returned from a call to ExtCreatePen EXTLOGPEN
HPEN LOGPEN
HBRUSH LOGBRUSH
HFONT LOGFONT
Returns:int

If the function succeeds, and lpvObject is a valid pointer, the return value is the number of bytes stored into the buffer.

If the function succeeds, and lpvObject is NULL, the return value is the number of bytes required to hold the information the function would store into the buffer.

If the function fails, the return value is zero.
SelectObjectback to summary
public WinNT.HANDLE SelectObject(WinDef.HDC hDC, WinNT.HANDLE hGDIObj)

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

Parameters
hDC:WinDef.HDC

Handle to the DC.

hGDIObj:WinNT.HANDLE

Handle to the object to be selected.

Returns:WinNT.HANDLE

If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the REGION values.

SetPixelback to summary
public int SetPixel(WinDef.HDC hDC, int x, int y, int crColor)

The SetPixel function sets the pixel at the specified coordinates to the specified color.

Parameters
hDC:WinDef.HDC

Handle to the device context.

x:int

Specifies the x-coordinate, in logical units, of the point to be set.

y:int

Specifies the y-coordinate, in logical units, of the point to be set.

crColor:int

Specifies the color to be used to paint the point. To create a COLORREF color value, use the RGB macro.

Returns:int

If the function succeeds, the return value is the RGB value that the function sets the pixel to. This value may differ from the color specified by crColor; that occurs when an exact match for the specified color cannot be found. If the function fails, the return value is 1. To get extended error information, call GetLastError. This can be the following value.

SetPixelFormatback to summary
public boolean SetPixelFormat(WinDef.HDC hdc, int iPixelFormat, WinGDI.PIXELFORMATDESCRIPTOR.ByReference ppfd)

The SetPixelFormat function sets the pixel format of the specified device context to the format specified by the iPixelFormat index.

Parameters
hdc:WinDef.HDC

Specifies the device context whose pixel format the function attempts to set.

iPixelFormat:int

Index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes.

ppfd:WinGDI.PIXELFORMATDESCRIPTOR.ByReference

Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification.

Returns:boolean

true if successful

SetRectRgnback to summary
public boolean SetRectRgn(WinDef.HRGN hrgn, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)

The SetRectRgn function converts a region into a rectangular region with the specified coordinates.

Parameters
hrgn:WinDef.HRGN

Handle to the region.

nLeftRect:int

Specifies the x-coordinate of the upper-left corner of the rectangular region in logical units.

nTopRect:int

Specifies the y-coordinate of the upper-left corner of the rectangular region in logical units.

nRightRect:int

Specifies the x-coordinate of the lower-right corner of the rectangular region in logical units.

nBottomRect:int

Specifies the y-coordinate of the lower-right corner of the rectangular region in logical units.

Returns:boolean

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.