to show a thumbnail of photo that I took-Phonegap [closed]

北慕城南 提交于 2019-12-11 15:09:00

问题


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?

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


回答1:


Try this:

$('#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  }
        );
});


来源:https://stackoverflow.com/questions/14043174/to-show-a-thumbnail-of-photo-that-i-took-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!