Results 1 to 2 of 2
  1.    #1  
    I'm playing around with the Pre SDK and I am trying to build a scene which can either display an image from a file or an image that was just taken by the camera.

    The portion of loading the image from disk works fine.

    For the camera, I am using the services call and I pass a filename parameter. The camera then returns and it stores the image in the filename. I then have it display the image and display the filename in the same function which made the call to the camera service. It only displays a blank image, but it outputs the correct filename.

    If I then select the image using the file browser, not only does it display the image, but it also returns the same filename as the one which the Camera App returned.

    I have attached the code from the camera button for reference:

    var d = new Date().getTime();
    var filestring = "/media/internal/app_images/Journal_" + d + ".jpg";
    { appId :'', name: 'capture' },
    { sublaunch : true, filename: filestring }

    //Does the program wait here for the camera?

    $('Image').src = filestring;
    $('CameraSelection').innerHTML = filestring;

    Any ideas on what the issue might be? Do I have the timing of the statements wrong? Does my program pause execution while it waits for the camera or not? I have tried it with sublaunch set to true and false and neither one works.
  2.    #2  
    Just for reference I thought I would post the solution to this problem.

    The scene which calls the camera has an activate function. This function is created when the scene is generated.

    It will be called when the scene is first loaded and when the camera app quits. In this function you can assign the image to the one that was just captured by the camera.

    See the sample camera code included with the SDK for more information.

Tags for this Thread

Posting Permissions