视频全屏播放(未写)

[java]  view plain copy
  1. public void Change_RawPicture_Size(SurfaceView view, RelativeLayout screen,  int orgW, int orgH, int screenW, int screenH){  
  2.       
  3.     RelativeLayout.LayoutParams params  =   
  4.         new RelativeLayout.LayoutParams(orgW, orgH);  
  5.       
  6.     params.leftMargin = (screenW - orgW)/2;  
  7.     params.topMargin  = 0;  
  8.       
  9.     m_SurfaceHolder.setFixedSize(params.width, params.height);  
  10.     view.setLayoutParams(params);  
  11.     screen.updateViewLayout(view, params);  
  12.     Log.i(TAG, "setFixedSize width="+params.width+";height="+params.height);  
  13. }  

[python]  view plain copy
  1. private void Set_Video_Scale(int flag) {  
  2.         switch(flag){  
  3.         case SCREEN_FULL:  
  4.         {  
  5.             RelativeLayout.LayoutParams params  =   
  6.                 new RelativeLayout.LayoutParams(m_screenWidth, m_screenHeight);  
  7.       
  8.             m_SurfaceView.setLayoutParams(params);  
  9.             m_bFullScreen = true;  
  10.         }  
  11.         break;  
  12.         case SCREEN_DEFAULT:  
  13.         {  
  14.             RelativeLayout.LayoutParams params  =   
  15.                 new RelativeLayout.LayoutParams(m_orgWidth, m_orgHeight);  
  16.               
  17.             params.leftMargin = (m_screenWidth - m_orgWidth)/2;  
  18.             params.topMargin  = 0;  
  19.               
  20.             m_SurfaceView.setLayoutParams(params);  
  21.             m_bFullScreen = false;  
  22.         }  
  23.         break;  
  24.         default:  
  25.             break;  
  26.         }  
  27.     }  
转自http://blog.csdn.net/stefzeus/article/details/6832645

你可能感兴趣的:(视频全屏播放(未写))