显示我拍摄的照片的缩略图-Phonegap [英] to show a thumbnail of photo that I took-Phonegap

查看:65
本文介绍了显示我拍摄的照片的缩略图-Phonegap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建用相机拍摄的照片的缩略图,但是失败了,有人可以给我个主意吗?

I'm trying to create a thumbnail of the photo that I take with the camera but I've failed, someone can give me an idea?

我' m使用PhoneGap,javascript,html和css

I'm working with PhoneGap, javascript, html and css

推荐答案

尝试一下:

$('#button').click(function(){
    navigator.camera.getPicture(
        function(imageURI){
            $('img').attr('src',imageURI).css({'background-size':  '100%', 'background-repeat': 'no-repeat', 'width': '100px'});
        },
        function(message) { alert('Get picture failed'); },
        { quality: 60, 
        destinationType: navigator.camera.DestinationType.FILE_URI, 
        sourceType: navigator.camera.PictureSourceType.CAMERA,
        mediaType: Camera.MediaType.PICTURE,
        correctOrientation: true  }
        );
});

这篇关于显示我拍摄的照片的缩略图-Phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆