Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to activate camera

Posted on 2006-11-17
8
Medium Priority
?
1,226 Views
Last Modified: 2013-11-18
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.
0
Comment
Question by:str_kani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 12

Author Comment

by:str_kani
ID: 17966925
i visited this already, FYI

i am using, VS 2005, VB
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 17973068
Microsoft is working on one now. But there is no "Official" one now.
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
LVL 12

Author Comment

by:str_kani
ID: 17973882
how this works out it Windows Mobile 5, can change my device if needed.
0
 
LVL 9

Expert Comment

by:checoo
ID: 18000885
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.Forms".

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.ShowDialog() == DialogResult.OK &&
    cameraCaptureDialog.FileName.Length > 0)
  {
    fileExtension = Path.GetExtension(cameraCaptureDialog.FileName);
    File.Copy(cameraCaptureDialog.FileName, 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.
0
 
LVL 12

Author Comment

by:str_kani
ID: 18003179
seems easy, would help me alot if you could convert this... thank you.
0
 
LVL 9

Accepted Solution

by:
checoo earned 2000 total points
ID: 18003249
Hope this helps --

Private Sub photoMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
 Dim cameraCaptureDialog As CameraCaptureDialog = New CameraCaptureDialog
 cameraCaptureDialog.Owner = Me
 cameraCaptureDialog.Title = "Take Exhibit Photo"
 cameraCaptureDialog.Mode = CameraCaptureMode.Still
 If cameraCaptureDialog.ShowDialog = DialogResult.OK AndAlso cameraCaptureDialog.FileName.Length > 0 Then
   fileExtension = Path.GetExtension(cameraCaptureDialog.FileName)
   File.Copy(cameraCaptureDialog.FileName, fileName)
   pictureBox.Image = New Bitmap(fileName)
 End If
End Sub
0
 
LVL 12

Author Comment

by:str_kani
ID: 18063670
Excellent!
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question