Exemplo n.º 1
0
 public static Win32.PAINTSTRUCT To32(Win16.PAINTSTRUCT ps16)
 {
     return(new Win32.PAINTSTRUCT()
     {
         hdc = HDC.To32(ps16.hdc),
         fErase = ps16.fErase != 0,
         rcPaint = ps16.rcPaint.Convert(),
         fRestore = ps16.fRestore != 0,
         fIncUpdate = ps16.fIncUpdate != 0,
     });
 }
Exemplo n.º 2
0
        public nint GetDeviceCaps(ushort hDC, nint cap)
        {
            // Tested on WinXP with 16, 24 and 32-bit color all return
            // 2048 for num colors on 16-bit windows
            // Assumes hDC is a screen DC
            // Also fixes tetris asking for NumColors on a released DC
            if (cap == Win16.NUMCOLORS && (!HDC.Map.IsValid16(hDC) || _GetDeviceCaps(HDC.To32(hDC), Win16.TECHNOLOGY) == Win16.DT_RASDISPLAY))
            {
                return(2048);
            }

            return(_GetDeviceCaps(HDC.To32(hDC), cap));
        }