How can I do a screenshot?or take a photo in the code?

Does Application.CaptureScreenshot work ? Or I can take the Image frame?

It does not work in MR mode, because Unity is not responsible for rendering. In MR mode, we use RealityKit for rendering. I’m not aware of a way to take screenshots from code in MR mode, and I suspect it’s disallowed for security reasons (because the screenshot would contain the output from the camera).