Languages

Menu
Sites
Language
I want to open a camera to capture image with desired size.

I want to open a camera to capture image with desired size.

Responses

9 Replies
Alex Dem

Hi,
I think you should use your camera application and set capture resolution with camera_set_capture_resolution api.
But you can't set any resolution , you should check possible capture resolutions with

int camera_foreach_supported_capture_resolution(camera_h camera,
        camera_supported_capture_resolution_cb callback, void *user_data);

not sure that you able to capture 96x96 photo.
Alexey.

Alex Dem

There is Self Camera app in Tizen  2.3.1 native samples. You could try to modify it accordingly.
Alexey.

Palitsyna

Hello,

just FYI, here is more information about camera_set_resolution() method: https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__CAPI__MEDIA__CAMERA__MODULE.html

and do not forget to add http://tizen.org/privilege/camera privilege to your tizen-manifest.xml file.

rohit sijwali

Actually i am using app_control the code is

 

#define CAMERA_APP_ID "tizen.camera"

#define CAMERA_OPERATION_ID "http://tizen.org/appcontrol/operation/create_content"

#define CAMERA_MIME_TYPE "image/jpeg"

 

int openCamera()

{

    app_control_h app_control;

    int ret = app_control_create(&app_control);

    int retStatus=CAMERA_ERROR;

if (ret == APP_CONTROL_ERROR_NONE)

    {

            app_control_set_app_id(app_control, CAMERA_APP_ID);

            app_control_set_operation(app_control, CAMERA_OPERATION_ID);

            app_control_set_mime(app_control,CAMERA_MIME_TYPE);

 

 

 

            ret = app_control_send_launch_request(app_control, _get_camera_cb, NULL);

 

            if (ret == APP_CONTROL_ERROR_NONE )

            {

                dlog_print(DLOG_ERROR, LOG_TAG, "Open Camera Sucessfull!");

                retStatus=CAMERA_SUCCESS;

 

 

            }

            else

            {

                switch(ret)

                {

                case APP_CONTROL_ERROR_INVALID_PARAMETER:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_INVALID_PARAMETER");

                    break;

                case APP_CONTROL_ERROR_OUT_OF_MEMORY:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_OUT_OF_MEMORY");

                    break;

                case APP_CONTROL_ERROR_APP_NOT_FOUND:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_APP_NOT_FOUND");

                    break;

                case APP_CONTROL_ERROR_KEY_NOT_FOUND:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_KEY_NOT_FOUND");

                    break;

                case APP_CONTROL_ERROR_KEY_REJECTED:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_KEY_REJECTED");

                    break;

                case APP_CONTROL_ERROR_INVALID_DATA_TYPE:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_INVALID_DATA_TYPE");

                    break;

                case APP_CONTROL_ERROR_LAUNCH_REJECTED:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_LAUNCH_REJECTED");

                    break;

                case APP_CONTROL_ERROR_PERMISSION_DENIED:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_PERMISSION_DENIED");

                    break;

                case APP_CONTROL_ERROR_LAUNCH_FAILED:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_LAUNCH_FAILED");

                    break;

                case APP_CONTROL_ERROR_TIMED_OUT:

                    dlog_print(DLOG_ERROR, LOG_TAG, "APP_CONTROL_ERROR_TIMED_OUT");

                    break;

                }

            }

 

        }

      else

      {

          retStatus=CAMERA_ERROR;

        }

 

    if (app_control != NULL){

        app_control_destroy(app_control);

    }

    return retStatus;

}

 

Can i set the resolution using  app_control_add_extra_data 

colin Rao

That's depend on what the extra date key which accepted by the camera. Question is how to know whether the camera support the resolution extra data and what's the key name. I can't get any help from the IDE help doc, possilbe some Samsung expert can clarify this issue. :)

Md. Mahbubul Huq

See the tuitorial of Media app available with the IDE.

It has camera capture and video recording codes.

in Tizen IDE 2.4:

File>New>Tizen Native Project>Online Sample>Media.

Md. Mahbubul Huq

I think int camera_set_capture_resolution(camera_h camera, int width, int height); will work.

Please see

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__CAPI__MEDIA__CAMERA__MODULE.html#ga089a602f3feae6abc8dbccab02479cdd

rohit sijwali

Hi i want to know whether the camera support the resolution extra data and what's the key name.

Alex Dem

Hi,
I did not fint such mention.
Alexey.