public int UxThemeDrawThemeBackground(IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle_ bounds) { XplatUIWin32.RECT BoundsRect = XplatUIWin32.RECT.FromRectangle(bounds); int result = UXTheme.DrawThemeBackground(hTheme, dc.GetHdc(), iPartId, iStateId, ref BoundsRect, IntPtr.Zero); dc.ReleaseHdc(); return(result); }
public void VisualStyleRendererDrawBackgroundExcludingArea(IntPtr theme, IDeviceContext dc, int part, int state, Rectangle_ bounds, Rectangle_ excludedArea) { XplatUIWin32.RECT bounds_rect = XplatUIWin32.RECT.FromRectangle(bounds); IntPtr hdc = dc.GetHdc(); XplatUIWin32.Win32ExcludeClipRect(hdc, excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom); UXTheme.DrawThemeBackground(theme, hdc, part, state, ref bounds_rect, IntPtr.Zero); IntPtr hrgn = XplatUIWin32.Win32CreateRectRgn(excludedArea.Left, excludedArea.Top, excludedArea.Right, excludedArea.Bottom); XplatUIWin32.Win32ExtSelectClipRgn(hdc, hrgn, (int)ClipCombineMode.RGN_OR); XplatUIWin32.Win32DeleteObject(hrgn); dc.ReleaseHdc(); }