Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
Implementing Render
The following code is used to implement the Render function:
Here is an explanation of the code:
A variable named mycolor is used for the color of the glow and is declared with COLORREF. All colors should use the COLORREF data type.
A variable named mylevel is used for the audio waveform level snapshot. This value will depend on the actual power level at the moment of the snapshot.
The switch statement is set by the preset that the user has chosen on Windows Media Player. The choice will set mycolor to the desired color (red, green, or blue). However, the exact color will be determined by the audio power level. For example, if the red preset is chosen, the color will be a solid red, but it will be lighter or darker depending on the audio waveform at the moment of the snapshot. Be sure to use the RBG macro to create your color.
A brush is created called hNewBrush, and it is used to fill the prc rectangle provided by Windows Media Player. The drawing surface is the hdc device context provided by Windows Media Player.
The brush is deleted by DeleteObject. Always be sure to delete any pens or brushes you create.
Once the Render code is finished, Windows Media Player will display the hdc graphics in a window determined by the skin being used.
See Also
| Previous | Next |