Pinch zoom in/out using gesture

How to implement pinch zoom in/out using fingers gesture for an imange through photocm object
static void
create_base_gui(appdata_s *ad)
{
	char buf[100];
	Evas_Object *image;

	/* Window */
	ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
	elm_win_autodel_set(ad->win, EINA_TRUE);

	if (elm_win_wm_rotation_supported_get(ad->win)) {
		int rots[4] = { 0, 90, 180, 270 };
		elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
	}

	evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
	eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);

	/* Conformant */
	ad->conform = elm_conformant_add(ad->win);
	elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
	elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
	evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(ad->win, ad->conform);
	evas_object_show(ad->conform);

	/* Naviframe */
	ad->naviframe = elm_naviframe_add(ad->conform);
	elm_object_content_set(ad->conform, ad->naviframe);

//add photocam object on naviframe
	image = elm_photocam_add(ad->naviframe);

	elm_bg_option_set(image, ELM_BG_OPTION_CENTER);

	snprintf(buf, sizeof(buf), "%s/photo.jpg", ICON_DIR);
//load an image
	elm_photocam_file_set(image, buf);
//initialized zoom mode set
	elm_photocam_zoom_mode_set(image, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL);
//enable finger gesture for an image object
	elm_photocam_gesture_enabled_set(image, EINA_TRUE);
	elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, image, NULL);

	eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
	evas_object_smart_callback_add(image, "clicked", zoom_stop_cb, NULL);
	/* Show window after base gui is set up */
	evas_object_show(ad->win);
}

Responses

0 Replies