开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜