c# - How to change media capture photo resolution for UWP? -


so have code takes photo in uwp app (running on windows desktops , phones) using code.

await _mediacapture.capturephototostreamasync(imageencodingproperties.createjpeg(), stream); 

and works great takes image @ full resolution of device... (so 44 megapixels on lumia 1020) big me. want limit resolution fixed size (say around 16 megapixel).

so there way of setting camera capture resolution or have capture @ full resolution , downscale myself?

you should able change resolution of mediacapture element setting mediastreamproperties after initialization:

// initialization here  // available resolutions var resolutions = capturemanager.videodevicecontroller.getavailablemediastreamproperties(mediastreamtype.photo).tolist(); // set used resolution await capturemanager.videodevicecontroller.setmediastreampropertiesasync(mediastreamtype.photo, resolutions[1]); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -