Hello all,
I'm using GDIPlus to display an image in a controls WM_PAINT event (BeginPaint, GdipCreateFromHDC, GdipDraw, GdipDeleteGraphics, EndPaint).
This works.
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);
GpGraphics *g;
GdipCreateFromHDC(hDC, &g); GdipDrawImage(g, img, 0, 0); GdipDeleteGraphics(g);
EndPaint(hWnd, &ps);
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 ?
Adding Sleep(100);
doesn't change anything (just noticeable when the control is partially out
of the screen)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 42:03:45 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,857,792 |