public interface GDI32 extends StdCallLibrary
gdi32.dll
.StdCallLibrary.StdCallCallback
Library.Handler
Modifier and Type | Field and Description |
---|---|
static GDI32 |
INSTANCE |
FUNCTION_MAPPER, STDCALL_CONVENTION
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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.
|
WinDef.HDC |
CreateCompatibleDC(WinDef.HDC hDC)
The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.
|
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.
|
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.
|
WinDef.HRGN |
CreatePolyPolygonRgn(WinDef.POINT[] lppt,
int[] lpPolyCounts,
int nCount,
int fnPolyFillMode)
The CreatePolyPolygonRgn function creates a region consisting of a series
of polygons.
|
WinDef.HRGN |
CreateRectRgn(int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect)
The CreateRectRgn function creates a rectangular region.
|
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.
|
boolean |
DeleteDC(WinDef.HDC hDC)
The DeleteDC function deletes the specified device context (DC).
|
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.
|
WinDef.HRGN |
ExtCreateRegion(Pointer lpXform,
int nCount,
WinGDI.RGNDATA lpRgnData)
The ExtCreateRegion function creates a region from the specified region and transformation data.
|
int |
GetDeviceCaps(WinDef.HDC hdc,
int nIndex)
The GetDeviceCaps function retrieves device-specific information for
the specified device.
|
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.
|
int |
GetObject(WinNT.HANDLE hgdiobj,
int cbBuffer,
Pointer lpvObject)
Retrieves information for the specified graphics object.
|
WinNT.HANDLE |
SelectObject(WinDef.HDC hDC,
WinNT.HANDLE hGDIObj)
The SelectObject function selects an object into the specified device context (DC).
|
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.
|
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.
|
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.
|
static final GDI32 INSTANCE
WinDef.HRGN ExtCreateRegion(Pointer lpXform, int nCount, WinGDI.RGNDATA lpRgnData)
lpXform
- 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
- Specifies the number of bytes pointed to by lpRgnData.lpRgnData
- Pointer to a RGNDATA structure that contains the region data in logical units.int CombineRgn(WinDef.HRGN hrgnDest, WinDef.HRGN hrgnSrc1, WinDef.HRGN hrgnSrc2, int fnCombineMode)
hrgnDest
- Handle to a new region with dimensions defined by combining two other regions.hrgnSrc1
- Handle to the first of two regions to be combined.hrgnSrc2
- Handle to the second of two regions to be combined.fnCombineMode
- Specifies a mode indicating how the two regions will be combined.WinDef.HRGN CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)
nLeftRect
- Specifies the x-coordinate of the upper-left corner of the region in logical units.nTopRect
- Specifies the y-coordinate of the upper-left corner of the region in logical units.nRightRect
- Specifies the x-coordinate of the lower-right corner of the region in logical units.nBottomRect
- Specifies the y-coordinate of the lower-right corner of the region in logical units.WinDef.HRGN CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse)
nLeftRect
- Specifies the x-coordinate of the upper-left corner of the region in logical units.nTopRect
- Specifies the y-coordinate of the upper-left corner of the region in logical units.nRightRect
- Specifies the x-coordinate of the lower-right corner of the region in logical units.nBottomRect
- Specifies the y-coordinate of the lower-right corner of the region in logical units.nWidthEllipse
- Specifies the width of the ellipse used to create the rounded corners in logical units.nHeightEllipse
- Specifies the height of the ellipse used to create the rounded corners in logical units.WinDef.HRGN CreatePolyPolygonRgn(WinDef.POINT[] lppt, int[] lpPolyCounts, int nCount, int fnPolyFillMode)
lppt
- 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
- 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
- Specifies the total number of integers in the array pointed to by lpPolyCounts.fnPolyFillMode
- Specifies the fill mode used to determine which pixels are in the region.boolean SetRectRgn(WinDef.HRGN hrgn, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)
hrgn
- Handle to the region.nLeftRect
- Specifies the x-coordinate of the upper-left corner of the rectangular region in logical units.nTopRect
- Specifies the y-coordinate of the upper-left corner of the rectangular region in logical units.nRightRect
- Specifies the x-coordinate of the lower-right corner of the rectangular region in logical units.nBottomRect
- Specifies the y-coordinate of the lower-right corner of the rectangular region in logical units.int SetPixel(WinDef.HDC hDC, int x, int y, int crColor)
hDC
- Handle to the device context.x
- Specifies the x-coordinate, in logical units, of the point to be set.y
- Specifies the y-coordinate, in logical units, of the point to be set.crColor
- Specifies the color to be used to paint the point. To create a COLORREF color value, use the RGB macro.WinDef.HDC CreateCompatibleDC(WinDef.HDC hDC)
hDC
- Handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the
application's current screen.boolean DeleteDC(WinDef.HDC hDC)
hDC
- Handle to the device context.WinDef.HBITMAP CreateDIBitmap(WinDef.HDC hDC, WinGDI.BITMAPINFOHEADER lpbmih, int fdwInit, Pointer lpbInit, WinGDI.BITMAPINFO lpbmi, int fuUsage)
hDC
- Handle to a device context.lpbmih
- Pointer to a bitmap information header structure, which may be one of those shown in the following table.fdwInit
- Specifies how the system initializes the bitmap bits.lpbInit
- Pointer to an array of bytes containing the initial bitmap data.lpbmi
- Pointer to a BITMAPINFO structure that describes the dimensions and color format of
the array pointed to by the lpbInit parameter.fuUsage
- 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.WinDef.HBITMAP CreateDIBSection(WinDef.HDC hDC, WinGDI.BITMAPINFO pbmi, int iUsage, PointerByReference ppvBits, Pointer hSection, int dwOffset)
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
- Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including
the bitmap dimensions and colors.iUsage
- 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
- Pointer to a variable that receives a pointer to the location of the DIB bit values.hSection
- Handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.dwOffset
- Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage
for the bitmap bit values is to begin.WinDef.HBITMAP CreateCompatibleBitmap(WinDef.HDC hDC, int width, int height)
hDC
- Handle to a device context.width
- Specifies the bitmap width, in pixels.height
- Specifies the bitmap height, in pixels.WinNT.HANDLE SelectObject(WinDef.HDC hDC, WinNT.HANDLE hGDIObj)
hDC
- Handle to the DC.hGDIObj
- Handle to the object to be selected.boolean DeleteObject(WinNT.HANDLE hObject)
hObject
- Handle to a logical pen, brush, font, bitmap, region, or palette.int GetDeviceCaps(WinDef.HDC hdc, int nIndex)
hdc
- A handle to the DC.nIndex
- The item to be returned.BITSPIXEL
and the device has 15bpp or
16bpp, the return value is 16.int GetDIBits(WinDef.HDC hdc, WinDef.HBITMAP hbmp, int uStartScan, int cScanLines, Pointer lpvBits, WinGDI.BITMAPINFO lpbi, int uUsage)
hdc
- A handle to the device context.hbmp
- A handle to the bitmap. This must be a compatible bitmap
(DDB).uStartScan
- The first scan line to retrievecScanLines
- The number of scan lines to retrieve.lpvBits
- 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 WinGDI.BITMAPINFO
structure pointed to
by the lpbi parameter.lpbi
- A pointer to a WinGDI.BITMAPINFO
structure that specifies
the desired format for the DIB data.uUsage
- The format of the bmiColors member of the WinGDI.BITMAPINFO
structure.int ChoosePixelFormat(WinDef.HDC hdc, WinGDI.PIXELFORMATDESCRIPTOR.ByReference ppfd)
hdc
- Specifies the device context that the function examines to determine the best
match for the pixel format descriptor pointed to by ppfd.ppfd
- Pointer to a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format.boolean SetPixelFormat(WinDef.HDC hdc, int iPixelFormat, WinGDI.PIXELFORMATDESCRIPTOR.ByReference ppfd)
hdc
- Specifies the device context whose pixel format the function attempts to set.iPixelFormat
- Index that identifies the pixel format to set. The various pixel formats supported
by a device context are identified by one-based indexes.ppfd
- Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification.int GetObject(WinNT.HANDLE hgdiobj, int cbBuffer, Pointer lpvObject)
hgdiobj
- 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(com.sun.jna.platform.win32.WinDef.HDC, com.sun.jna.platform.win32.WinGDI.BITMAPINFO, int, com.sun.jna.ptr.PointerByReference, com.sun.jna.Pointer, int)
function.cbBuffer
- The number of bytes of information to be written to the
buffer.lpvObject
- 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.
Object type | Data written to buffer |
WinDef.HBITMAP |
WinGDI.BITMAP |
WinDef.HBITMAP returned from a call to
CreateDIBSection(com.sun.jna.platform.win32.WinDef.HDC, com.sun.jna.platform.win32.WinGDI.BITMAPINFO, int, com.sun.jna.ptr.PointerByReference, com.sun.jna.Pointer, int)
|
DIBSECTION, if cbBuffer is set to sizeof(DIBSECTION), or BITMAP, if cbBuffer is set to sizeof (BITMAP). |
WinDef.HPALETTE |
A WinDef.WORD count of the number of entries in the
logical palette |
WinDef.HPEN returned from a call to ExtCreatePen |
EXTLOGPEN |
WinDef.HPEN |
LOGPEN |
WinDef.HBRUSH |
LOGBRUSH |
WinDef.HFONT |
LOGFONT |
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.