PATCOPY test case

From: anonymous (anonymous_at_discussions.microsoft.com)
Date: 02/23/05


Date: Wed, 23 Feb 2005 14:27:03 -0800

Is it possible to generate a PATCOPY with a brush that isn't the same color
depth as the device context being blitted ?

I got sample code from a chip vendor which I believe has a bug, I'm trying
to program a test case to prove its broken and then fix it, but I'm not able
to get the case, and my MFC/WINAPI skills in this area are razor sharp.

What I want to do it to try to PATCOPY a 24-bpp brush into a 16-bpp device
context.

I have:

CBitmap patern;
patern.LoadBitmap(IDB_BITMAP1);
CBrush mybursh(&patern);

dc.SetBrushOrg(4, 4);
dc.SelectObject(mybursh);
dc.BitBlt(0, 0, rc.right+1-rc.left, rc.bottom+1-rc.top, NULL, 0, 0, PATCOPY);

The dc receives the blit, but the brush is 16bpp whereas the bitmap is
24bpp. I'm thinking the SelectObject call must do the conversion, but I don't
know any other way to code it.

Will all PATCOPY blit's always receive a pattern which is the same color
depth as the DC by definition ?