Kani Str
asked on
how to activate camera
I have an application that need to activate the camera and let the user save the photo, i am not sure how to do this, don't know what API does this.... please help.
http://windowsmobilepro.blogspot.com/2006/04/using-camera-api-with-only-embedded.html
ASKER
i visited this already, FYI
i am using, VS 2005, VB
i am using, VS 2005, VB
Microsoft is working on one now. But there is no "Official" one now.
ASKER
how this works out it Windows Mobile 5, can change my device if needed.
With the Windows Mobile 5.0 software a generic camera API is now defined that device manufacturers support. The .NET Compact Framework, Windows Mobile 5.0 software includes a ready-made dialog named CameraCaptureDialog available in , and you can find it in the "Microsoft.WindowsMobile.F orms".
An indicative sample code is given below
private void photoMenuItem_Click(object sender, EventArgs e)
{
CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog();
cameraCaptureDialog.Owner = this;
cameraCaptureDialog.Title = "Take Exhibit Photo";
cameraCaptureDialog.Mode = CameraCaptureMode.Still;
if(cameraCaptureDialog.Sho wDialog() == DialogResult.OK &&
cameraCaptureDialog.FileNa me.Length > 0)
{
fileExtension = Path.GetExtension(cameraCa ptureDialo g.FileName );
File.Copy(cameraCaptureDia log.FileNa me, fileName());
pictureBox.Image = new Bitmap(fileName());
}
}
The above is a C# code but can be converted fairly easily to VB.NET. Let me know if you need any help.
An indicative sample code is given below
private void photoMenuItem_Click(object
{
CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog();
cameraCaptureDialog.Owner = this;
cameraCaptureDialog.Title = "Take Exhibit Photo";
cameraCaptureDialog.Mode = CameraCaptureMode.Still;
if(cameraCaptureDialog.Sho
cameraCaptureDialog.FileNa
{
fileExtension = Path.GetExtension(cameraCa
File.Copy(cameraCaptureDia
pictureBox.Image = new Bitmap(fileName());
}
}
The above is a C# code but can be converted fairly easily to VB.NET. Let me know if you need any help.
ASKER
seems easy, would help me alot if you could convert this... thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent!