Method ChoosePixelFormat
ChoosePixelFormat(nint, ref PIXELFORMATDESCRIPTOR)
Chooses the pixel format that best matches the specified device context and pixel format descriptor.
public static extern int ChoosePixelFormat(nint hdc, ref MswUtils.NativeMethods.PIXELFORMATDESCRIPTOR pfd)
Parameters
hdcnintA handle to the device context for which the pixel format is to be selected.
pfdMswUtils.NativeMethods.PIXELFORMATDESCRIPTORA reference to a MswUtils.NativeMethods.PIXELFORMATDESCRIPTOR structure that specifies the desired pixel format attributes.
Returns
- int
The index of the pixel format that best matches the specified requirements, or 0 if the function fails.
Remarks
This method is a wrapper for the native ChoosePixelFormat function in
the GDI32 library. The returned index can be used with other GDI functions to set or query the pixel
format of the device context.