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: | 171 |
Nodes: | 16 (1 / 15) |
Uptime: | 13:26:02 |
Calls: | 3,403 |
Calls today: | 11 |
Files: | 10,830 |
Messages: | 3,209,188 |
Posted today: | 1 |