Solved

how to activate camera

Posted on 2006-11-17
8
1,216 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 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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