I'm using GDIPlus to display an image in a controls WM_PAINT event (BeginPaint, GdipCreateFromHDC, GdipDraw, GdipDeleteGraphics, EndPaint).
The problem occurs when I move another window over the control : I get a mish-mash of the origional image interleaved with gray areas following moved-over window.
Although I've found some ham-fisted solution by calling 'InvalidateRect'
just before 'BeginPaint' (causing a second paint event which covers op the gray areas) I would like to know what correct way is to handle the problem.
Remark: I'm using the "flat api" set of GDI+ functions - on XPsp3.
Main window :
static hWndStatic = NULL;
HDC hDC = BeginPaint(hWnd, &ps);
GdipCreateFromHDC(hDC, &g); GdipDrawImage(g, img, 0, 0); GdipDeleteGraphics(g);
Just thought of something: Could you add a Sleep (of 50... 100 ms) just before calling GdipDrawImage and see if that changes anything for you ?
Its not anything that will lead to a solution, but it would hammer down the cause.
Just thought of something: Could you add a Sleep (of 50... 100 ms) just
before calling GdipDrawImage and see if that changes anything for you ?
doesn't change anything (just noticeable when the control is partially out
of the screen)
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||16 (1 / 15)|