locked
how to use the cameracapture ? RRS feed

  • Question

  • hello:) im new to programming in .net compact framework and i dont understand how the camera dialogue works, ive read it and tried it, i guess i need a library for it or something.. what library does it belong to? or can you give me a sample code.. like say if i press the button it will open the camera.. how do i do that? im using an o2 mobile and its windows mobile 5.. 

    thanx to anyone who can help:)
    Sunday, May 24, 2009 5:29 PM

Answers

  • Right-click on your project and select "Add Reference."  You will be able to select the "Microsoft.WindowsMobile.Forms" assembly.  In the top of your source code add the statement "using Microsoft.WindowsMobile.Forms;"

    Joel Ivory Johnson
    • Marked as answer by monkey28 Monday, May 25, 2009 7:05 PM
    Monday, May 25, 2009 4:31 PM
  • You need to install WM 5.0 (or 6.0) SDK. It would work with VS 2005 SE or above.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by monkey28 Monday, May 25, 2009 7:05 PM
    Monday, May 25, 2009 5:10 PM

All replies

  • You probably forgot to add a reference to Microsoft.WindowsMobile.Forms. 

                //Create the camera capture dialog
                using (CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog())
                {                
                    //Show the camera dialog. 
                    DialogResult dr = cameraCaptureDialog.ShowDialog();
    
                    //If the Dialog result is OK then the user has taken a picture 
                    //and the picture has been saved.
                    if (dr == DialogResult.OK)
                    {
                        // Checking the name of the file that is assigned to the
                        //picture that was just taken
                        string capturedFileName = cameraCaptureDialog.FileName;
                    }
    
                }
    

    Joel Ivory Johnson
    Sunday, May 24, 2009 9:50 PM
  • thanx, i tried it but still it wont work.. :( 
    where did you get the Microsoft.WindowsMobile.Forms lib? do i have to download it..? and i get the logic how but i just dont get this part:

    using (CameraCaptureDialog cameraCaptureDialog = new CameraCaptureDialog()) <-- the CameraCaptureDialog is 
    suppose to turn into a different color right? but its still black.. so it means im lacking a lib and 
    i dont know what lib it belongs to..

    thanx again:)
    Monday, May 25, 2009 4:26 PM
  • Right-click on your project and select "Add Reference."  You will be able to select the "Microsoft.WindowsMobile.Forms" assembly.  In the top of your source code add the statement "using Microsoft.WindowsMobile.Forms;"

    Joel Ivory Johnson
    • Marked as answer by monkey28 Monday, May 25, 2009 7:05 PM
    Monday, May 25, 2009 4:31 PM

  • i dont have it.. haha.. where can i download it?:)

    thanx again!
    Monday, May 25, 2009 4:53 PM
  • Assuming you are using Visual Studio 2008 Professional it would have installed with the Smart Device Programmability option.  In otherwords if your VS installation is configured to allow Windows Mobile development then it is there.  Make sure you have the .Net tab selected on the "Add Reference" dialog.


    Joel Ivory Johnson
    Monday, May 25, 2009 4:58 PM
  • that's why.. im using the Visual Studio 2005.. do i really have to use 2008? cause we use 2005 at my school:) 
    Monday, May 25, 2009 5:01 PM
  • You need to install WM 5.0 (or 6.0) SDK. It would work with VS 2005 SE or above.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by monkey28 Monday, May 25, 2009 7:05 PM
    Monday, May 25, 2009 5:10 PM
  • do u mind giving me the download link?:) i would really appreciate it:) thanx so much! 
    Monday, May 25, 2009 5:25 PM
  • i found it! thanx so much for all your help guys:) really appreciate it.. 
    Monday, May 25, 2009 7:04 PM