Skip to content Skip to sidebar Skip to footer

How To Get Real Camera Max Megapixels Of A Device?

I'm trying to find the REAL Camera max Megapixels of a device and i tested some code found on stackoverflow and google with cam.getParameters().getSupportedPictureSizes();, but the

Solution 1:

so i dont understand why 5888x3312 is returend by getSupportedPictureSizes()

Because that is what the manufacturer thinks is the largest supported picture size. Try taking a picture at that size -- if it fails, then there is a bug in this device. If it succeeds, then perhaps you are wrong about the camera resolution.

i dont know how i must ignore non real values like that value

You don't, other than through testing. Device manufacturers return curious values from getSupportedPictureSizes() all the time.

Solution 2:

Cameracamera= Camera.open();
ParametersparamOfCamera= camera.getParameters();
android.hardware.Camera.SizesizeOfImage= paramOfCamera.getPictureSize();
intwidth= sizeOfImage .width ;
intheight= sizeOfImage .height ;

doublepixelOfCamera= (width*height)/1024000 ;

Updated

List<Size> sizes = paramOfCamera .getSupportedPictureSizes();
Size mSize = null;
for (Size size : sizes) {
        System.out.println("Size =="+size.width+"==Height=="+size.height);
        break;
}

You will get all supported size but first index will give maximum picture size.

Solution 3:

if you've got the camera object, try

android.hardware.Camera.Parametersparameters= camera.getParameters();
android.hardware.Camera.Sizesize= parameters.getPictureSize();


intheight= size.height;
intwidth= size.width;

As the megapixels in the pickup device in your camera increase so does the possible maximum size image you can produce. This means that a 5 megapixel camera is capable of capturing a larger image than a 3 megapixel camera.

Example: 1936 x 1552 / 1024000 = 3 Mega Pixels

Post a Comment for "How To Get Real Camera Max Megapixels Of A Device?"