Advertisement
vamsiampolu

Using getBestPictureSize instead

Jan 20th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Getting the largest picture size:
  2.  
  3.  private Size getBestPictureSize(List<Size> supportedSizeList)
  4.     {
  5.         Size result=null;
  6.         for(Size size:supportedSizeList)
  7.         {
  8.             if(result==null)
  9.                 result=size;
  10.                 int resultArea=result.width*result.height;
  11.                 int sizeArea=size.width*size.height;
  12.                 if(resultArea<sizeArea)
  13.                     result=size;
  14.         }
  15.         return result;
  16.     }
  17.  
  18. The result in the Logcat upon using this function are:
  19.  
  20. CameraActivity(1979): Width: 720 Height: 1184
  21. PreviewFrameLayout(1979): Width: 720 Height: 540
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement