如何在phonegap上的gallery中选择的img标签中显示图像?

时间:2016-06-04 10:12:35

标签: html5 cordova phonegap-build

 <script>
        function text()
        {
                            // Retrieve image file location from specified source
                            navigator.camera.getPicture(onSuccess, onFail,
                            {

                                                   quality: 50,
                                    destinationType: Camera.DestinationType.FILE_URI,
                                    sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
                            });


        }
    function onSuccess(imageData)
    {
        alert('success image date ='+imageData);
        document.getElementById('myImage').src=imageData;
    }
    function onFail(message)
    {
        alert('Failed because: ' + message);
    }

当我从 File_Uri 获取图片的路径时,但使用此网址无法获取图片。

该路径与content://com.android.providers.media.documents/document/image%3a39762

类似
 <img id"myImage" alt="choosed images" height="200" width="200">

0 个答案:

没有答案