Esempio n. 1
0
        private IList <CameraPixelFormat> GetSupportedPreviewPixelFormats()
        {
            List <CameraPixelFormat> previewFormats = new List <CameraPixelFormat>();

            NativeCapabilities.PreviewFormatCallback callback = (CameraPixelFormat format, IntPtr userData) =>
            {
                previewFormats.Add(format);
                return(true);
            };
            CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewPixelFormats(_camera.GetHandle(), callback, IntPtr.Zero),
                                            "Failed to get the supported preview formats.");

            return(previewFormats.AsReadOnly());
        }
Esempio n. 2
0
        private IList <CameraPixelFormat> GetSupportedPreviewPixelFormats()
        {
            var previewFormats = new List <CameraPixelFormat>();

            NativeCapabilities.PreviewFormatCallback callback = (format, _) =>
            {
                previewFormats.Add(format);
                return(true);
            };

            NativeCapabilities.SupportedPreviewPixelFormats(_camera.GetHandle(), callback).
            ThrowIfFailed("Failed to get the supported preview formats.");

            return(previewFormats.AsReadOnly());
        }