Ejemplo n.º 1
0
        private IList <Size> GetSupportedPreviewResolutions()
        {
            List <Size> previewResolutions = new List <Size>();

            NativeCapabilities.PreviewResolutionCallback callback = (int width, int height, IntPtr userData) =>
            {
                previewResolutions.Add(new Size(width, height));
                return(true);
            };
            CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewResolutions(_camera.GetHandle(), callback, IntPtr.Zero),
                                            "Failed to get the supported preview resolutions");

            return(previewResolutions.AsReadOnly());
        }
Ejemplo n.º 2
0
        private IList <Size> GetSupportedPreviewResolutions()
        {
            var previewResolutions = new List <Size>();

            NativeCapabilities.PreviewResolutionCallback callback = (width, height, _) =>
            {
                previewResolutions.Add(new Size(width, height));
                return(true);
            };

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

            return(previewResolutions.AsReadOnly());
        }