Hello,
You can use native API to judge the device has 4k camera capabilities.
For Android, you need to add camera permission.
<uses-permission android:name="android.permission.CAMERA" />
Then use this var res=cameraParams.SupportedPictureSizes;
get all of camera capabilities. If the value of width is over 4096 and the value of height is over 2160, this device has 4k camera capabilities.
public bool getBackCameraResolutionInMp()
{
int noOfCameras = Android.Hardware.Camera.NumberOfCameras;
float maxResolution = -1;
long pixelCount = -1;
for (int i = 0; i < noOfCameras; i++)
{
Android.Hardware.Camera.CameraInfo cameraInfo = new CameraInfo();
Android.Hardware.Camera.GetCameraInfo(i, cameraInfo);
if (cameraInfo.Facing == Android.Hardware.CameraFacing.Back)
{
Android.Hardware.Camera camera = Android.Hardware.Camera.Open(i); ;
Android.Hardware.Camera.Parameters cameraParams = camera.GetParameters();
var res=cameraParams.SupportedPictureSizes;
for (int j = 0; j < cameraParams.SupportedPictureSizes.Count; j++)
{
if (cameraParams.SupportedPictureSizes[j].Width>4096&& cameraParams.SupportedPictureSizes[j].Height>2160)
{
return true;
}
return false;
}
camera.Release();
}
}
return false;
}
For iOS, you can use supportedMaxPhotoDimensions to get the maximum photo dimension
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.