Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 8.1 Media Capture Orientation C#

I'm converting an app to use the new Media Capture api in Windows Phone 8.1.

When I capture a photo using

mediaCaptureManager.CapturePhotoToStorageFileAsync

the file is saved and the photo orientation is landscape left as expected.

Now, when I capture a photo in portrait up orientation, there doesn't seem to be anywhere for me to set the jpg encode option for orientation, so the photo in still saved landscape left (the orientation of the sensor).

I have seen example code that re-encodes the StorageFile file after capture to rotate it, but this seems to be an expensive task.

There is an option to SetRecordRotation but that is only for video capture.

Am I missing something here?

I would have expected to be able to set orientation prior to capture, say in the image encoding properties argument of the CapturePhotoToStorageFileAsync method. But it looks like only the format type, height and width can be set?

Any guidance or example would be a great help!!

like image 850
user3734728 Avatar asked Jul 03 '14 08:07

user3734728


1 Answers

Without any more details its hard to give much help beyond saying that the MediaCapture.CapturePhotoToStorageFileAsync looks to be a very simplified way to capture photos. The documentation definitely does not have any methods for setting orientation.

I did find an article on Advanced Photo Capture for Windows Phone 8, which uses Advanced capture properties and does have methods for setting the orientation.

Hope this helps.

like image 166
CodeCrafterTroy Avatar answered Oct 02 '22 19:10

CodeCrafterTroy