Select to view content in your preferred language

Take a photo by camera

676
3
11-11-2011 03:04 AM
MaximilianGlas
Esri Contributor
Hi,

is it possible to take a photo with the build-in camera with ArcGIS Mobile 10.0 standard application (desktop platform with usb camera)?
Has anyone done this yet?
Or is the only chance to do this with a 3rd party software and then to "browse for picture"?

Greetings, Max
0 Kudos
3 Replies
RobertMEIER
Regular Contributor
I have used this code on a Trimble Juno device with a built in camera.

I just put it in the click event of a button.

            CameraCaptureDialog cameraDlg = new CameraCaptureDialog();
            cameraDlg.StillQuality = CameraCaptureStillQuality.Normal;
            cameraDlg.Mode = CameraCaptureMode.Still;
            cameraDlg.InitialDirectory = frmMain._workingPath + @"\Images";
            if (cameraDlg.ShowDialog() == DialogResult.OK)
            {
                pbxPreview.Image = new Bitmap(cameraDlg.FileName);
                LoadImageList();
            }

Then I have a picturebox to preview the image, also a list to manage images:

        private void LoadImageList()
        {
            lbxImages.Items.Clear();
            DirectoryInfo di = new DirectoryInfo(frmMain._workingPath + @"\images");

            foreach (FileInfo fi in di.GetFiles("*.jpg"))
            {
                lbxImages.Items.Add(fi.Name);
            }

            btnDeleteImage.Enabled = false;

        }

Then I give the user the ability to delete the image they are previewing:

        private void btnDeleteImage_Click(object sender, EventArgs e)
        {
            string selImg = lbxImages.SelectedItem.ToString();
            if (selImg == "")
            {
                MessageBox.Show("No Image Selected");
                return;
            }
            File.Delete(frmMain._workingPath + @"\images\" + selImg);
            LoadImageList();
            pbxPreview.Image = null;
            pbxPreview.Invalidate();
        }
0 Kudos
HenrikSvenningsen
Deactivated User
Your FeatureClass has to have a field Named Picture_1 and has to be Raster. Then you can attach 1 picture. You can also have several Picture_2, Picture_3 fields with BLOB as format, but those you can see in ArcMap, but you can then have multiple picture in Mobile attached to one object.

There is no "out of the box" function in Mobile to attach a photo directly to the object....you have to have the field above and the "browse" for it.

But it will automatic syncronize them back to ArcMap and to your geodatabase, where you can use them.
0 Kudos
MaximilianGlas
Esri Contributor
Trimble Juno means ArcGIS Mobile for Windows Mobile.
Thats a different platform.
That may be the reason why I do not find a CameraCaptureDialog class.
0 Kudos