本文介绍了在全屏模式下停止Windows媒体播放器的屏幕方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正面临着Windows媒体播放器的问题。 我在播放器运行时处理屏幕旋转。 当玩家处于全屏模式时,我想停止屏幕方向。 请提出任何建议。 我使用下面的代码  Hi,I am facing an issue with windows media player.I am handling screen rotation while player is running.when the player is in full screen mode, i would like to stop screen orientation.Any suggestion please.i am using following code  private void _orentationChanged_Changed( 对象 发件人, ChangeEventArgs args) {private void _orentationChanged_Changed(object sender, ChangeEventArgs args){   if (axWindowsMediaPlayer1!= null ) {if (axWindowsMediaPlayer1 != null){ menuScreenHeight = System.Windows.Forms。menuScreenHeight = System.Windows.Forms. SystemInformation 。MenuHeight; screenHeight =SystemInformation.MenuHeight;screenHeight = Screen .PrimaryScreen.Bounds.Height - 2 * menuScreenHeig ht; screenWidth =Screen.PrimaryScreen.Bounds.Height - 2 * menuScreenHeight;screenWidth = 屏幕 PrimaryScreen.Bounds.Width。 InitializeComponent(); /./播放器初始化Screen.PrimaryScreen.Bounds.Width;InitializeComponent();/./player initialization}}如何停止播放器处于全屏模式时的屏幕方向 问候 Maheshhow can i stop screen orientation of the when player is in fullscreen modeRegardsMahesh推荐答案 hi Mahesh, 你可以选择一个布尔变量&当您的播放器处于全屏模式时,将其指定为True。 假设 公共静态布尔值为FullScreen = False;  /声明 如果(播放器处于全屏模式)  //您的条件 {           isFullScreen = true; 现在在 _ orentationChanged_Changed()方法中检查如下 private void _orentationChanged_Changed(object sender,ChangeEventArgs args) {    if(!isFullScreen)     {      if(axWindowsMediaPlayer1!= null)         {           menuScreenHeight = System.Windows.Forms。         SystemInformation.MenuHeight;          screenHeight = Screen.PrimaryScreen.Bounds.Height - 2 * menuScreenHeight;          screenWidth = Screen.PrimaryScreen.Bounds.Width;         InitializeComponent(); /./播放器初始化       }    }    其他为    {          &的   //什么都不做  祝你有所帮助。hi Mahesh,You can take one boolean variable & assign it to True when your player is in Full screen mode.Suppose public static bool isFullScreen = False ;  /Declaration If (player is in Full screen mode)  // Your condtion{           isFullScreen = true;}Now in _orentationChanged_Changed() method check like this private void _orentationChanged_Changed(object sender, ChangeEventArgs args) {   if ( ! isFullScreen)    {      if (axWindowsMediaPlayer1 != null)        {         menuScreenHeight = System.Windows.Forms.         SystemInformation.MenuHeight;          screenHeight = Screen.PrimaryScreen.Bounds.Height - 2 * menuScreenHeight;          screenWidth = Screen.PrimaryScreen.Bounds.Width;         InitializeComponent();/./player initialization      }   }   else    {              // Do Nothing   }}Hope this will help you. 这篇关于在全屏模式下停止Windows媒体播放器的屏幕方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-04 23:45