Steffen
2010-01-06 09:44:01 UTC
I've got a problem drawing GDI-generated graphics into a window device
context; when the corresponding window is moved with the mouse, the output
sometimes is drawn at incorrect locations, causing "smearing" and broken
shapes. It seems as if the origin of the DC is not synchronized with the
(moving) window surface.
This problems occurs under the following circumstances:
1. The drawing occurs in an MDI child window.
2. The operating system is Windows 7. Flavor doesn't matter. Desktop
theme/composition doesn't matter. IAW: The problem also occurs in
the "Basic" theme!
3. The drawing is performed by a separate thread, aka a thread different
from the one which called CreateWindow().
Note that the corresponding code ran fine all the way through from Windows
9x ;-).
The drawing code is pretty simple (and could probably be reduced even
further):
(Pseude Code, runs in separate thread)
hDC = GetDC(...)
for x:=0 to 100
MoveToEx( hDC, x, 50, NULL )
LineTo( hDC, x, 150 )
next
ReleaseDC( ... )
A sample can be easily provided.
I probably should have posted this to a Windows 7-related forum. I couldn't
find one, though.
Does anyone have an idea what might be causing this?
Thanks,
Steffen
context; when the corresponding window is moved with the mouse, the output
sometimes is drawn at incorrect locations, causing "smearing" and broken
shapes. It seems as if the origin of the DC is not synchronized with the
(moving) window surface.
This problems occurs under the following circumstances:
1. The drawing occurs in an MDI child window.
2. The operating system is Windows 7. Flavor doesn't matter. Desktop
theme/composition doesn't matter. IAW: The problem also occurs in
the "Basic" theme!
3. The drawing is performed by a separate thread, aka a thread different
from the one which called CreateWindow().
Note that the corresponding code ran fine all the way through from Windows
9x ;-).
The drawing code is pretty simple (and could probably be reduced even
further):
(Pseude Code, runs in separate thread)
hDC = GetDC(...)
for x:=0 to 100
MoveToEx( hDC, x, 50, NULL )
LineTo( hDC, x, 150 )
next
ReleaseDC( ... )
A sample can be easily provided.
I probably should have posted this to a Windows 7-related forum. I couldn't
find one, though.
Does anyone have an idea what might be causing this?
Thanks,
Steffen