Exemplo n.º 1
0
 public static extern int DescribePixelFormat(IntPtr hdc, int n, int un,
     ref PixelFormatDescriptor lpPixelFormatDescriptor);
Exemplo n.º 2
0
 /// <summary>
 /// The DescribePixelFormat function obtains information about the pixel format identified by iPixelFormat 
 /// of the device associated with hdc. The function sets the members of the PIXELFORMATDESCRIPTOR structure 
 /// pointed to by lpPixelFormatDescriptor with that pixel format data
 /// </summary>
 /// <param name="hdc">Specifies the device context</param>
 /// <param name="iPixelFormat">Index that specifies the pixel format. The pixel formats that a device context supports 
 /// are identified by positive one-based integer indexes</param>
 /// <param name="nBytes">The size, in bytes, of the structure pointed to by lpPixelFormatDescriptor. 
 /// The DescribePixelFormat function stores no more than nBytes bytes of data to that structure. 
 /// Set this value to sizeof(PIXELFORMATDESCRIPTOR)</param>
 /// <param name="lpPixelFormatDescriptor">Pointer to 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 nSize member.
 /// If, upon entry, lpPixelFormatDescriptor 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</param>
 /// <returns>If the function succeeds, the return value is the maximum pixel format index of the device context. In addition, the function sets
 /// the members of the PIXELFORMATDESCRIPTOR structure pointed to by lpPixelFormatDescriptor according to the specified pixel format.
 /// </returns>
 public static int DescribePixelFormat(IntPtr hdc, int iPixelFormat, int nBytes,
     ref PixelFormatDescriptor lpPixelFormatDescriptor)
 {
     return Native.DescribePixelFormat(hdc, iPixelFormat, nBytes, ref lpPixelFormatDescriptor);
 }