Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Mobile: using phone's camera with C#

I want to show the image that mobile phone's camera its taking on a control in a WinForm. The idea is that my application works like camera's program. I want to show the image like if the user is going to take a photo.

How can I do that? Can I do that?

If you need more details ask me.

Thank you!

like image 360
VansFannel Avatar asked Jul 04 '09 17:07

VansFannel


People also ask

How can I use my phone as a webcam in USB C?

To enable it, go to Settings > About Phone and tap on the 'Build number' 7 times. Launch the DroidCam app on your phone and make sure the phone is connected to the laptop or PC. Now launch the DroidCam Client on the PC and click on the 'USB' option.

Can I use mobile camera as webcam on PC?

If your PC and phone are on the same network, you can use an Android app to connect both devices and use the phone camera as a webcam. The app will register your Android phone as a webcam for the PC, so all apps that check your PC for webcam availability will use your Android phone camera instead.


2 Answers

Not very sure what you need, but you may try using Microsoft.WindowsMobile.Forms.CameraCaptureDialog:

    string originalFileName;
    using (CameraCaptureDialog dlg = new CameraCaptureDialog()) {
        dlg.Mode = CameraCaptureMode.Still;
        dlg.StillQuality = CameraCaptureStillQuality.Low;
        //dlg.Resolution = new Size(800, 600);
        dlg.Title = "Take the picture";
        DialogResult res;
        try {
            res = dlg.ShowDialog();
        }
        catch (Exception ex) {
            Trace.WriteLine(ex);
            return null;
        }

        if (res != DialogResult.OK)
            return null;
        this.Refresh();
        originalFileName = pictureFileName = dlg.FileName;
    }

Later Edit: Some of you might find useful this link, too: http://community.intermec.com/t5/General-Development-Developer/CN50-MS-Camera-Capture-Dialog-generates-error/m-p/12881#M4083

like image 96
Adi Avatar answered Sep 18 '22 18:09

Adi


What you want is a preview, not the capture, which is far more difficult. The best (and maybe only) solution is to insert a DShow Filter into the filtergraph to pipe the preview window to where you want.

COM is a bear in the Compact Framework, and DShow is tough no matter what platform you're on. There are some resources online, like the DShow.NET library at sourceforge, and Alex Mogurenko's blog, but nothing specific to creating a capture.

There is a native capture sample in the WinMo SDK that would be a useful guide to getting you there.

like image 26
ctacke Avatar answered Sep 21 '22 18:09

ctacke