Solved

how to activate camera

Posted on 2006-11-17
8
1,206 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
  • 4
  • 2
  • 2
8 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 17966863
0
 
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
 
LVL 12

Author Comment

by:str_kani
ID: 17973882
how this works out it Windows Mobile 5, can change my device if needed.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now