Re: Problem with GDI and Aero
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 10:45:04 -0400
The whole sequence is suspect. If you are drawing a bitmap inside a dialog box, you would
be doing it int he OnPaint handler, which means there is no reason to call GetDC. So what
is the purpose of GetDC? What is the purpose of ClientToScreen/ScreenToClient? Why in
the world are you doing GetDlgItem? If the bitmap is being drawn in a static control,
then the static control's WM_PAINT handler is where you should be doing the work; it makes
no sense to have the dialog draw into a child control. I'd suggest fixing the code so it
is in the correct place doing the correct thing before trying to figure out why Aero is
defeating it; I suspect the reason it doesn't work is that the code is flat-out wrong, and
Aero does not support having a parent do random drawing on the surface of a child control
(a paradigm so unnatural that Aero probably refuses to support it)
The correct code would be in the WM_PAINT handler for the child control in which you are
drawing, and would be
BeginPaint
LoadBitmap
GetObject
GetClientRect
CreateCompatibleDC
SelectObject
BitBlt
EndPaint
or, actually, choose a static control with the SS_BITMAP style and just do SetBitmap to it
and the default behavior is that it will draw itself!
joe
On Thu, 31 Jul 2008 11:29:20 +0200, "Erwan" <Erwan@xxxxxxxxxx> wrote:
I use the following api to display a bitmap inside a dialogbox:.
GetDC
LoadBitmap
GetObject
GetDlgItem
GetClientRect
ClientToScreen
ScreenToClient
CreateCompatibleDC
SelectObject
BitBlt
Under Vista with Aero, the bitmap is not displayed. With Aero deactivated or
XP,
the bitmap is correctly displayed. Even with Aero, there is no api error.
I tried various values for BitBlt (SRCCOPY, etc...) without success.
Thanks for your help.
- References:
- Problem with GDI and Aero
- From: Erwan
- Problem with GDI and Aero
- Prev by Date: Re: Writing to 8-bit memory bitmap
- Next by Date: Re: Writing to 8-bit memory bitmap
- Previous by thread: Problem with GDI and Aero
- Index(es):
Relevant Pages
|
Loading