News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ColorTrackbar is a flicker demonstrator.

Started by hotrod, January 22, 2010, 01:14:59 AM

Previous topic - Next topic

hotrod

To see the flickering, move the trackbars quickly and change the fonts. Flicker is a problem and I decided to take a look at it since graphics is a new subject for me. This is based strictly on font and color using trackbars, choosefont and choosecolor. Most of the code is repetition, but it uses several controls and options such as copy to clipboard. The interesting part is that it demonstrates what happends when font size is changed and the difference between how the position of the text is rendered. Click in the rectangle to change the text. Hope it is useful.

dedndave

very cool - although, i see no flicker   :8)

hotrod

You PC may be faster than my 1.73 - yea, but it has been a good one.

dedndave

perhaps it is the video adapter
but - is there some specific condition that exacerbates the flicker ?
maybe i am not punching the wrong buttons   :P

hotrod

I have found that increasing the font size and moving the trackbars rapidly will cause it. It takes the system longer to redraw the font because of all the attributes connected with them. Try the TextOut Center because of the caluclations involved.

dedndave

well - i enlarged the font and mashed all the buttons - lol
i still see no flicker
what worries me is, i will be able to write bad code that has a flicker problem and i won't know it - lol

hotrod

The rule of thumb I came up with is to do the following in order will be the most efficient:

Always use smallest font possible.

1.  Use TextOut and left justify.    ; Fastest.
2.  Use TextOut and hard code to center.
3.  Use DrawText if you want to center.
4.  Use TextOut and calculate center.    ; Slowest.

My machine is a laptop (always slow display update) and it is a Latitude D810 which is more than 4 years old so it is slow video update with little memory. Get you an old machine to test on and your home.