Forum

Is it possible to take pictures with the Camera of Pleo Rb?

Início Fóruns Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?

A visualizar 2 artigos - de 1 a 2 (de um total de 2)
  • Autor
    Artigos
  • pleoworld
    Convidado
    Número de artigos: 172

    Hello,

    “camera_take_picture” returns a boolean result, it should be checked.

    Unfortunately “camera_take_picture” only starts the process of taking and saving a picture. It is a slow process, and you need to keep checking a special (undocumented) property to see when it is done.

    Also, be careful with strings stored as data. Unless you need data in a variable, use a literal string. Otherwise it wastes valuable RAM. Also be sure you have “#pragma pack 1” near the start of the source file.

    Here is some code I use in my test program:

    Code: [Select]
    #include “Camera.inc”

    //IF NEEDED
    native bool: camera_take_picture(const file_name[]);
    // some versions of SDK do not have it in Camera.inc

    #pragma pack 1


    // save the picture
    if (camera_take_picture(“A:one.img”)) // save on SD card
    {
    PlaySound(snd_cap_one); // shutter sound
    // wait until done saving
    while (get(property_cam_img_progress) != 0)
    {
    yield();
    }
    // now the picture is saved
    PlaySound(snd_camera_saved);
    }
    else
    {
    PlaySound(snd_capture_error);
    }

    Jacob
    Convidado
    Número de artigos: 172

    JacoThank you very much for your answer.

A visualizar 2 artigos - de 1 a 2 (de um total de 2)
  • Tem de iniciar sessão para responder a este tópico.

Início Fóruns Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?