Speichern eines PNG- oder JPG-Bildes in Fotos in iOS über PhoneGap

Ich bin neu bei PhoneGap und möchte wissen, wie ich ein In-App-Bild in Fotos in iOS speichern kann.

Während ich benutzen konnte

navigator.camera.getPicture

mit Optionen

quality:50, destinationType:Camera.DestinationType.DATA_URL,saveToPhotoAlbum: true

Um ein mit der Kamera aufgenommenes Bild in Fotos zu speichern, versuche ich jetzt herauszufinden, wie ein In-App-Bild in Fotos gespeichert werden kann.

Betrachten Sie die folgende PhoneGap - Cordova - Seite, auf der das Element myPhoto Bilddaten enthält, z. B. "data: image / jpeg; base64," ...

<html>
    <head>
    <title>Save Image</title>
    <script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
    <script type="text/javascript" charset="utf-8">


    function savePicture(){
                    //this is where the magic would happen
                    //how can I save myPhoto to Photos?
                    //output imageData to a jpg or png file which would show up in Photos?
    }

        </script>
</head>
<body>
    <button onclick="savePicture();">Save Photo</button> <br>
            <input type="hidden" name="myPhoto" id="myPhoto" value="">
</body>
</html>

Frage:

Was sollte savePicture () tun, um die Bilddaten von myPhoto auf Fotos in iOS über Phonegap zu speichern?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage