예제 #1
0
        public static SafeGDIHandle CreateDib(Rectangle bounds, IntPtr primaryHdc, SafeDeviceHandle memoryHdc)
        {
            BITMAPINFO 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
            SafeGDIHandle 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);