|
||
Rendering did not succeed on some Win9x/ME systems - the AlphaBlend . Fixed by using all code alpha blending for any pre-2000 system. |
Media Progress Bar RendererHow to render a gradient progress bar like the one in Windows Media Player Windows Media Player has a neat progress bar showing how its getting on whilst burning files to CD or other long operations. This article presents a reusable class which draws a progress bar in a similar presentation. The resulting bar can be drawn to anything that exposes an hDC, and therefore can be integrated with a progress bar or even a Custom-Draw ListView exactly as Media Player does. Using the ClassThe class has two modes of operation: automatic sizing (which emulates the rendering performed by Media Player) and user-defined sizing. These are controlled by the AutoSize flag.
The other properties control the appearance of the bar. The background of the progress bar always draws black. The colour of the progress effect is controlled using the BarColor property: typically you will set this to a bright colour since the border and gradient bar will be rendered in a darker shade of this colour and only the text at the leading edge of the progress bar is actually in the pure form of the colour. The Text property sets the text displayed on the bar, ShowPercent tells the control whether to display a percentage progress at the end of the caption. You can set the percentage progress either by using the Min, Max and Value properties, or by setting the Percent property directly. Rendering DescriptionRendering of the bar proceeds in three stages:
|
|
|