skamlet
skamlet

Reputation: 691

Camera Output in fullscreen - Windows Phone

I'm working on augmented reality and I wanted to know if it was possible to get the camera output in fullscreen with a normal scale. I'm currently able to get a deformed output (everything is larger than in the real world).

Edit: I found in the PhotoCamera class on msdn that I have to use camera.AvailableResolutions. This returns an IEnumrable of Size, each one being a supported resolution.

Upvotes: 1

Views: 889

Answers (2)

Emond
Emond

Reputation: 50682

Based on your comment:

I do not understand this. Do you mean to say that the aspect ratio is wrong; squares becoming rectangular? Could it be that you are displaying/stretching the picture incorrectly?

Yeah that's what I mean, the image is stretched because the camera is taking an image in 640x480 and the screen is in 800x480

In the UI where you display the image, set the Stretch to None, Uniform or UniformToFill. Do not use Fill that will distort the image.

<Image Source="..." Stretch="Uniform" />

See these examples on the MSDN

Upvotes: 2

Ku6opr
Ku6opr

Reputation: 8126

Each phone has different lens focal length and screen size. There is no API to scale camera output to physical dimensions of real world (to see the world on the screen like through transparent window). Also, the distance from user eyes to the phone is affected to what should be displayed. You could experimentally find average scale factor to best map camera output to phone screen.

EDIT: From the beginning it was like the question was not about distortions on different screen orientations but like augmented reality problem.

Upvotes: 0

Related Questions