Open ITaluone opened 1 month ago
i suggest you select the camera using next code to assure to use the correct position camera
for (int i = 0; i < cameraView.Cameras.Count; i++) { if (cameraView.Cameras[i].Position == Camera.MAUI.CameraPosition.Front) {
cameraView.Camera = cameraView.Cameras[i];
break;
}
}
Ahm.. I only have two cameras back and front. I want to select the back camera (which is the first one) but when I select it, it crashes.
Edit: This makes no difference at all..
change CameraPosition.Front to CameraPosition.Back
Hi
We have an issue with this to take a photo, because it is throwing an NRE somewhere inside this method, but I cannot tell where exactly.
Platform: Android Framework: .NET8.0
This is our code in question:
I cannot give more information, unfortunately, because of lack of stack trace and such.
Can you give me a hint what this causes?
Edit:
The stack trace looks like this (not terribly helpful IMHO):
If the
cameraView.Camera
from above is loaded withcameraView.Cameras.First()
(meaning the back camera) this NRE occurs, but when loading the front cameracameraView.Cameras.Last()
this works fine, but showing the back camera stream in thecameraView
.