예제 #1
0
        private IList <Size> GetSupportedCaptureResolutions()
        {
            List <Size> cameraResolutions = new List <Size>();

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

            return(cameraResolutions.AsReadOnly());
        }
예제 #2
0
        private IList <Size> GetSupportedCaptureResolutions()
        {
            var cameraResolutions = new List <Size>();

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

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

            return(cameraResolutions.AsReadOnly());
        }