Hi,
I am experiencing a problem that I cannot resolve when I use DirectX and GDI+ at the same time in a user control.
I have a background drawn with DirectX and something drawn in the foreground with GDI+. All drawing is handled in the controls OnPaint function.
When the form with the control is made visible everything is as expected. Now imagine that, while the form is up, you change focus to a different program running positioned so that it occupies half of the form with my drawing in it, dividing it into two regions, A and B, A being visible and B is hidden from view. The visible part, A, still contains both foreground and background of my drawing while the form is out of focus, but when I change focus back to the form the problem occurs. On changing focus back to the form the background and foreground is displayed as normal in part B, but in part A the background only is visible. It's as if only part A of the form is refreshed, and only the background is refreshed.
When the form is resized both back- and foreground are refreshed as expected.
If I am making myself clear, do you know how I can prevent this?
I am experiencing a problem that I cannot resolve when I use DirectX and GDI+ at the same time in a user control.
I have a background drawn with DirectX and something drawn in the foreground with GDI+. All drawing is handled in the controls OnPaint function.
When the form with the control is made visible everything is as expected. Now imagine that, while the form is up, you change focus to a different program running positioned so that it occupies half of the form with my drawing in it, dividing it into two regions, A and B, A being visible and B is hidden from view. The visible part, A, still contains both foreground and background of my drawing while the form is out of focus, but when I change focus back to the form the problem occurs. On changing focus back to the form the background and foreground is displayed as normal in part B, but in part A the background only is visible. It's as if only part A of the form is refreshed, and only the background is refreshed.
When the form is resized both back- and foreground are refreshed as expected.
If I am making myself clear, do you know how I can prevent this?