Class GDI32



  • public class GDI32
    extends java.lang.Object
    Native bindings to wingdi.h and gdi32.dll.
    • Method Detail

      • ChoosePixelFormat

        public static int ChoosePixelFormat(long hdc,
                                            PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
        Attempts to match an appropriate pixel format supported by a device context to a given pixel format specification.
        Parameters:
        hdc - the device context that the function examines to determine the best match for the pixel format descriptor pointed to by pixelFormatDescriptor
        pixelFormatDescriptor - a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format
      • DescribePixelFormat

        public static int DescribePixelFormat(long hdc,
                                              int pixelFormat,
                                              int bytes,
                                              PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
        Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format index of the device context.
        Parameters:
        hdc - the device context
        pixelFormat - index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes.
        bytes - the size, in bytes, of the structure pointed to by pixelFormatDescriptor. The wglDescribePixelFormat function stores no more than bytes bytes of data to that structure. Set this value to PIXELFORMATDESCRIPTOR.SIZEOF.
        pixelFormatDescriptor - a PIXELFORMATDESCRIPTOR structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure's size member. If, upon entry, pixelFormatDescriptor is NULL, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context.
      • DescribePixelFormat

        public static int DescribePixelFormat(long hdc,
                                              int pixelFormat,
                                              PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
        Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format index of the device context.
        Parameters:
        hdc - the device context
        pixelFormat - index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes.
        pixelFormatDescriptor - a PIXELFORMATDESCRIPTOR structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure's size member. If, upon entry, pixelFormatDescriptor is NULL, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context.
      • GetPixelFormat

        public static int GetPixelFormat(long hdc)
        Obtains the index of the currently selected pixel format of the specified device context.
        Parameters:
        hdc - the device context of the currently selected pixel format index returned by the function
      • SetPixelFormat

        public static boolean SetPixelFormat(long hdc,
                                             int pixelFormat,
                                             PIXELFORMATDESCRIPTOR pixelFormatDescriptor)
        Sets the pixel format of the specified device context to the format specified by the pixelFormat index.
        Parameters:
        hdc - the device context whose pixel format the function attempts to set
        pixelFormat - index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes.
        pixelFormatDescriptor - a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The system's metafile component uses this structure to record the logical pixel format specification. The structure has no other effect upon the behavior of the SetPixelFormat function.
      • SwapBuffers

        public static boolean SwapBuffers(long dc)
        Exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer.
        Parameters:
        dc - a device context. If the current pixel format for the window referenced by this device context includes a back buffer, the function exchanges the front and back buffers.