Beispiel #1
0
        public void Init(CameraOptions objOptions)
        {

            Xdk.OnCameraPictureAdd += OnCamera;
            Xdk.OnCameraPictureBusy += OnCamera;
            Xdk.OnCameraPictureCancel += OnCamera;

            console.Log("camera object wrapper initialized");

            if (objOptions.inject != null)
            {
                //inject a div to display an image and a camera button
                HtmlDivElement cameraDiv = new HtmlDivElement();
                cameraDiv.id = "cameradiv";
                document.body.AppendChild(cameraDiv);

                HtmlImageElement imgLarge = new HtmlImageElement();
                imgLarge.id = "largeImage";
                imgLarge.style.display = "none";
                Element.GetById("cameradiv").AppendChild(imgLarge);

                HtmlButtonElement btnCapture = new HtmlButtonElement();
                btnCapture.id = "btnPicture";
                btnCapture.innerText = "Take Picture";
                Xdk.multitouch.Add(btnCapture, TouchEventType.TouchStart, CapturePhoto);
                Element.GetById("cameradiv").AppendChild(btnCapture);
            }
        }
Beispiel #2
0
        public void Init(CameraOptions objOptions)
        {
            Xdk.OnCameraPictureAdd    += OnCamera;
            Xdk.OnCameraPictureBusy   += OnCamera;
            Xdk.OnCameraPictureCancel += OnCamera;

            console.Log("camera object wrapper initialized");

            if (objOptions.inject != null)
            {
                //inject a div to display an image and a camera button
                HtmlDivElement cameraDiv = new HtmlDivElement();
                cameraDiv.id = "cameradiv";
                document.body.AppendChild(cameraDiv);

                HtmlImageElement imgLarge = new HtmlImageElement();
                imgLarge.id            = "largeImage";
                imgLarge.style.display = "none";
                Element.GetById("cameradiv").AppendChild(imgLarge);

                HtmlButtonElement btnCapture = new HtmlButtonElement();
                btnCapture.id        = "btnPicture";
                btnCapture.innerText = "Take Picture";
                Xdk.multitouch.Add(btnCapture, TouchEventType.TouchStart, CapturePhoto);
                Element.GetById("cameradiv").AppendChild(btnCapture);
            }
        }