DrawThemeBackground to bitmap
I am trying to use DrawThemeBackground to draw to a bitmap in C#, but it always comes out as black.
Bitmap bmp = new Bitmap(this.Width, this.Height, PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(bmp))
{
g.Clear(Color.Green);
IntPtr hdc = g.GetHdc();
DrawThemeBackground(hTheme, hdc, 0, 1, ref rect, IntPtr.Zero);
g.ReleaseHdc(hdc);
}
It appears that DrawThemeBackground isn't looking at the background colour of the bitmap (green in this case)开发者_C百科 and is always blending with black. Am I missing something here? Is this even possible to do?
精彩评论