Пример #1
0
        public static SafeGDIHandle CreateDib(Rectangle bounds, IntPtr primaryHdc, SafeDeviceHandle memoryHdc)
        {
            var info = new BITMAPINFO();

            info.biSize        = Marshal.SizeOf(info);
            info.biWidth       = bounds.Width;
            info.biHeight      = -bounds.Height;
            info.biPlanes      = 1;
            info.biBitCount    = 32;
            info.biCompression = 0; // BI_RGB
            var dib = CreateDIBSection(primaryHdc, info, 0, IntPtr.Zero, IntPtr.Zero, 0);

            SelectObject(memoryHdc, dib);
            return(dib);
        }
Пример #2
0
 public static extern void GetThemeTextExtent(IntPtr hTheme, SafeDeviceHandle hdc, int iPartId, int iStateId,
                                              string text, int iCharCount, int dwTextFlags, [In] ref RECT bounds, out RECT rect);
Пример #3
0
 public static extern bool BitBlt(IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight,
                                  SafeDeviceHandle hdcSrc, int nXSrc, int nYSrc, uint dwRop);
Пример #4
0
 public static extern void DrawThemeTextEx(IntPtr hTheme, SafeDeviceHandle hdc, int iPartId, int iStateId,
                                           string text, int iCharCount, int dwFlags, ref RECT pRect, ref DTTOPTS pOptions);
Пример #5
0
 public static extern IntPtr SelectObject(SafeDeviceHandle hDC, SafeGDIHandle hObject);