Re: Graphics help
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Nov 15, 1998
- 520 views
David Cuny writes: > I've been working on scrollbars in Dos32Lib, and I've got a question. > Redrawing the scrollbars displays a lot of "flashing" as the graphics are > redone. This is something which I would rather avoid. If it's mainly a problem of "flicker" and not overall slowness, there are some techniques you can try. (Maybe you've thought of these already): 1. When updating an area of the screen, try to calculate the final picture of what it should look like before drawing it. Avoid displaying the intermediate stages. For example if you are moving an object, like a scroll bar, from point A to point B, an obvious solution is to "blank" it out at position A and redraw it at B. This will cause flicker as the monitor will sometimes refresh when the bar is blanked out, before it has been redrawn. There would be far less flicker if you could redraw the image of the whole updated area in "one shot". i.e. draw the bar including some trailing "blank" pixels, to wipe out the previous image of the bar. 2. You might be able to update just the ends of the scroll bar, not the whole bar, to effectively move it. 3. You might wait for the vertical blank period of the monitor before updating the screen. There's some machine code for that around somewhere. Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/