Click to See Complete Forum and Search --> : I need help to synchronize an image with the screen refreshing


Alcarbone
December 4th, 2003, 05:35 AM
(MFC et VC++7)

i write an application which posts data converted into BMP line (752 pixels).
These lines is draw on screen at the rate of source acquisition (ultrasound).
All occurs well on a traditional screen, but on a TFT a flutter of the image appears.
I use ScrollWindowEx() to move the image to the bottom of a line then my function writes the first line top.

It is possible to synchronize the creation and the displacement of the image with beginning of the screen refreshing ?
Tanks

galathaea
December 5th, 2003, 01:35 PM
Alot of this more-hardware level stuff is done through video ports (ie. the IDirectDrawVideoPort interface). You have the GetLine method to retrieve the current line being written to the frame buffer, WaitForSync to align timing, etc. If you alternate syncs between a location in the top half and a location in the bottom half, you can write out the other half of the screen than is triggered, ensuring that any page drawn is fully consistent.