Camera Aspect Ratio

D

darylhurst

I'm developing some software on a series of devices including an O2
XDA Exec, Palm Treo 750 and an HP iPaq hw6915. All of these devices
have a built in camera with different resolutions.
My question is are there any APIs (with examples) that let you query
the resolution of the camera? I've seen reference to Microsoft Windows
Image Aquisition (WIA) constants but cannot find any example code that
uses these.
Alternatively if I knew that the aspect ratio of all WM 5.0 mobile
device camera's is always fixed at 1.3333 then this would also help
e.g. 640x480 yields 1.3333, 1280x1024 yields 1.3333 etc. but I suppose
this is purely down to the hardware chosen by the manufacturer or is
it defined anywhere by Microsoft?
 
F

Fabien

Hi,

You can use the "CameraCaptureDialog " :
CameraCaptureDialog myCam = new CameraCaptureDialog();
myCam.Mode = CameraCaptureMode.Still;
myCam.Resolution = new Size(160, 120); // CHoose the resolution you
want
myCam.StillQuality = CameraCaptureStillQuality.Low;
myCam.ShowDialog();

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
 
D

darylhurst

Hi,

You can use the "CameraCaptureDialog " :
CameraCaptureDialog myCam = new CameraCaptureDialog();
myCam.Mode = CameraCaptureMode.Still;
myCam.Resolution = new Size(160, 120); // CHoose the resolution you
want
myCam.StillQuality = CameraCaptureStillQuality.Low;
myCam.ShowDialog();

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/



- Show quoted text -

Fabien,

Thanks for your response.

I was more interested in whether you could query beforehand the
resolution(s) that the camera supports, my understanding is that the
low level camera hardware will support a single fixed resolution e.g.
1280x1024 and that Windows Mobile scales the image afterwards
according to the size specified in CameraCaptureDialog.Resolution. In
my application I basically have a blank picturebox which I want to
size correctly according to the camera's aspect ratio BEFORE a photo
is taken so that the resultant image fits correctly albeit potentially
scaled down. I could resize the picturebox once the photo has been
taken and I know the dimensions of the actual image but this makes my
application a little ugly and involves potential movement of other
controls below the picturebox on the same form.
It would just be nice to call an API that returns the camera's max
resolution e.g. 1280x1024 (with an aspect ratio of 1280/1024=1.3333)
and then size my picturebox accordingly e.g. 200x
150 where 150 is (200 / (1280/1024)).

Daryl.
 
B

Brunocal

Hi i'm using CameraCaptureDialog but the image I take has a poor resolution (comparing to HP photosmart software). Also the I can't set Size(1280,1040)
Any ideas?
 
Top