Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jun : Auto change text color in progressbar?
| Subject: | Auto change text color in progressbar? |
| Posted by: | "Dave Atkin" (musictroni..@optusnet.com.au) |
| Date: | Mon, 26 Jun 2006 08:34:36 |
Hi all,
I am using a ProgressBar, extended to show a solid bar, and show the
Position (as a percentage of Max) as text in the centre of the control, and
I am trying to figure out how to get the text color to change from black to
white as the bar progresses accross it. Is there an API function to do
this? I'm thinking along the lines of checking the text color, pixel by
pixel, in a couple of nested loops, and changing it if the pixel next to it
has the same color as the bar, but I'm not sure if this is the right way.
Obviously this function would only need to be called while the bar crosses
the area where the text needs to be drawn.
If anyone can point me at an example of how to do this, it would be greatly
appreciated.
Many thanks,
Dave Atkin.