语言

Menu
Sites
Language
Image Cropping

I am working on application in which, I am using image cropper.
but when I set cropped image in layout part, it gets blurred, stratched and resolution gets low.
Here is my code. Please help me out of this.
 

void
crop_image_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) {

    appdata_s *ad = user_data;

	char** path;
	int length;
	int ret;
	char buf[PATH_MAX];

	if(result == APP_CONTROL_RESULT_SUCCEEDED) {

		ret = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &path, &length);

		if(ret == APP_CONTROL_ERROR_NONE) {

			int i;
			for(i=0; i<length;i++) {

				dlog_print(DLOG_DEBUG,LOG_TAG,"Cropped image path: %s", path[i]);
				snprintf(buf, sizeof(buf), "%s",path[i]);
				free(path[i]);
			}

				sprintf(ad->img_path,"%s",buf);
				elm_image_file_set(ad->img,ad->img_path,NULL);

			free(path);
		}
	}
}

void
crop_image(char* path,void *data) {

	appdata_s *id = data;

	app_control_h app_control = NULL;
	app_control_create(&app_control);
	app_control_set_operation(app_control, "http://tizen.org/appcontrol/operation/image/crop");
	app_control_set_uri(app_control, path);
	if(app_control_send_launch_request(app_control, crop_image_cb, ad) == APP_CONTROL_ERROR_NONE)
	  LOGI("Crop preview launched!");

	app_control_destroy(app_control);
}

 

编辑者为: bhoomika rathod 27 2月, 2018

响应

1 回复
Yasin Ali

Hi,

Possibly its due to dimension mismatch with target frame where
you open this image .

elm_image_file_set(ad->img,ad->img_path,NULL);