Windows Media Player 11 SDK IWMPNetwork.frameRate (VB and C#)
Previous | Next |
IWMPNetwork.frameRate (VB and C#)
The frameRate property gets the current video frame rate.
Property Value
A System.Int32 that is the current frame rate in frames per hundred seconds.
Note
Although the encodedFrameRate property measures the encoded frame rate in frames per second, the frameRate property measures the current frame rate in frames per hundred seconds. See Remarks.
Remarks
The current frame rate value is returned in frames per hundred seconds. For example, a value of 2998 indicates 29.98 frames per second (fps).
Example Code
The following code example uses frameRate to display the frame rate specified when the file was encoded. The information is displayed in a label in response to the PlayStateChange Event. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
' Create an event handler for the PlayStateChange event. Public Sub player_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles player.PlayStateChange ' Display the frameRate when the player is playing. Select Case e.newState Case 3 ' Play State = WMPLib.WMPPlayState.wmppsPlaying = 3 If (player.network.frameRate <> 0) Then frameRateLabel.Text = "Current Frame Rate: " + player.network.frameRate + " K bits/second" End If End Select End Sub
FakePre-fd75cea8e66f4ed6bf61c48176b540e0-2971e1b9c5a6443ca620a94611ee1bc0
// Add a delegate for the PlayStateChange event. player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange); // Create an event handler for the PlayStateChange event. private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { // Display the frameRate when the player is playing. switch (e.newState) { case 3: // Play State = WMPLib.WMPPlayState.wmppsPlaying = 3 if (player.network.frameRate != 0) { frameRateLabel.Text = "Current Frame Rate: " + player.network.frameRate + " K bits/second"; } break; default: break; } }
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
Previous | Next |