언어 설정

Menu
Sites
Language
adding image on camera preview without using edc file

Hi,

I want to know is it possible to add image on camera preview without using EDC file ? 

I have a edc file where i am currently flash_btn image on camera preview. But i want to add the flash_btn image to be drawn from the main-view.c file. How i can do this without using the edc file ?

 

images
{
    image: IMAGE_PATH"bar.png" COMP;

   image: IMAGE_PATH"none.png" COMP;

    image: IMAGE_PATH"transparent.png" COMP;

    image: IMAGE_PATH"flash.png" COMP;
} //images

collections
{

    base_scale: 1.8;

    group
    {
        name: "layout";
        parts
        {
            /*
            part
            {
                name: "bottom_bar";
                type: IMAGE;
                description
                {
                    fixed: 1 1;
                    rel1 { relative: 0.0 0.93; }
                    rel2 { relative: 1.0 1.0; }
                    visible: 1;
                    image.normal: IMAGE_PATH"bar.png";
                }
            } //part
             */
            part
            {
                name: "elm.swallow.content";
                type: SWALLOW;
                description
                {
                    rel1 { relative: 0.0 0.0; }
                    rel2 { relative: 1.0 1.0; }
                    visible: 1;
                }
            } //part
         
            part
            {
                name: "transparent_object";
                type: SWALLOW;
                description
                {
                    rel1 { relative: 0.0 0.0; }
                    rel2 { relative: 1.0 1.0; to: elm.swallow.content; }
                    color: 255 255 255 0;
                }
            } //part
         
             part
            {
                name: "flash_btn";
                type: IMAGE;
                description
                {
                    fixed: 1 1;
                    rel1 { relative: 0.62 0.59; to: transparent_object; }
                    rel2 { relative: 0.78 0.62; to: transparent_object; }
                    min: 40 40;
                    max: 70 70;
                    visible: 1;
                    image.normal: IMAGE_PATH"flash.png";
                }
            } //part

 I already some code but i am not sure if it is the right proceedure. below is the code. 

   

Evas_Object *img = elm_image_add(view->layout);
elm_image_file_set(img, "edje/images/flash.png", NULL);
evas_object_image_preload(img,EINA_TRUE);
elm_object_part_content_set(view->layout, "flash_btn", img);
evas_object_image_fill_set(img, 0,0, 40, 70);
elm_object_signal_emit(view->layout, "elm.swallow.content",  view->preview_canvas);
evas_object_show(img);

Thanks again

Responses

5 댓글
Alex Dem

Hi,
I suppose that if you do not want use layout markup from edc you should not use elm_object_part_content_set in this case.
Alexey.

Shahadat Hossain

Then can you guide me what is the right proceedure. Please let me know.

 

Thank you 

Jean Yang

Hi, 

You can find the media sample in IDE help, and in Camera and player, can has the preview and image view, hope this can help.

Shahadat Hossain

Hi Jean,

I want to draw an image object on top a camera preview by using Evas_object. How i can do this without using EDC file? Please let me know. 

Vikram

strange~

I am afraid you can't draw image on camera previewing screen. I don't face such case, also don't find any dev guide on IDE help.