2014-03-13 37 views
2

我正在尋找將在android中執行視頻旋轉的程序代碼。如何在Android中旋轉視頻90,180或270度?

我以前使用下面的代碼完成圖像旋轉。

bMap = BitmapFactory.decodeResource(getResources(), R.drawable.aa_presell_ribs); 

//Create object of new Matrix. 
matrix = new Matrix(); 

//set image rotation value to 270 degrees in matrix. 
matrix.postRotate(270); 

//Create bitmap with new values. 
Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0, bMap.getWidth(), bMap.getHeight(), matrix, true); 

//put rotated image in ImageView. 
imageView.setImageBitmap(bMapRotate); 

我已經搜索谷歌和其他來源,但我無法找到這樣的代碼。

回答

-1

你只需將圖像旋轉視圖

就像這個... 但它會工作11 API,只有......美分%,該公司將致力於

imageView1 =(ImageView) findViewById(R.id.imageView1); 
    imageView1.setRotation((float)90); 

你只使用視頻視圖替換圖像視圖

private VideoView videoView1; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 
    videoView1 =(VideoView) findViewById(R.id.videoView1); 
    videoView1.setRotation((float)90); 

} 

這將正常工作....

+1

好的但我想旋轉視頻。有什麼辦法可以在android中進行視頻配給嗎? – Hemant