• <legend id='0VE62'><style id='0VE62'><dir id='0VE62'><q id='0VE62'></q></dir></style></legend>

      <i id='0VE62'><tr id='0VE62'><dt id='0VE62'><q id='0VE62'><span id='0VE62'><b id='0VE62'><form id='0VE62'><ins id='0VE62'></ins><ul id='0VE62'></ul><sub id='0VE62'></sub></form><legend id='0VE62'></legend><bdo id='0VE62'><pre id='0VE62'><center id='0VE62'></center></pre></bdo></b><th id='0VE62'></th></span></q></dt></tr></i><div id='0VE62'><tfoot id='0VE62'></tfoot><dl id='0VE62'><fieldset id='0VE62'></fieldset></dl></div>
    1. <small id='0VE62'></small><noframes id='0VE62'>

      • <bdo id='0VE62'></bdo><ul id='0VE62'></ul>

        <tfoot id='0VE62'></tfoot>

        通过 PhoneGap 将 PNG 或 JPG 图像保存到 iOS 中的照片

        Saving a PNG or JPG image to Photos in iOS via PhoneGap(通过 PhoneGap 将 PNG 或 JPG 图像保存到 iOS 中的照片)

          • <bdo id='C6eSV'></bdo><ul id='C6eSV'></ul>

              <tfoot id='C6eSV'></tfoot>
              <i id='C6eSV'><tr id='C6eSV'><dt id='C6eSV'><q id='C6eSV'><span id='C6eSV'><b id='C6eSV'><form id='C6eSV'><ins id='C6eSV'></ins><ul id='C6eSV'></ul><sub id='C6eSV'></sub></form><legend id='C6eSV'></legend><bdo id='C6eSV'><pre id='C6eSV'><center id='C6eSV'></center></pre></bdo></b><th id='C6eSV'></th></span></q></dt></tr></i><div id='C6eSV'><tfoot id='C6eSV'></tfoot><dl id='C6eSV'><fieldset id='C6eSV'></fieldset></dl></div>
            1. <legend id='C6eSV'><style id='C6eSV'><dir id='C6eSV'><q id='C6eSV'></q></dir></style></legend>

                    <tbody id='C6eSV'></tbody>

                  <small id='C6eSV'></small><noframes id='C6eSV'>

                  本文介绍了通过 PhoneGap 将 PNG 或 JPG 图像保存到 iOS 中的照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 PhoneGap 的新手,想知道如何将应用内图像保存到 iOS 中的照片.

                  I am new to PhoneGap and would like to know how to save an in-App image to Photos in iOS.

                  虽然我可以使用

                  navigator.camera.getPicture
                  

                  有选项

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

                  要将使用相机拍摄的照片保存到照片中,我现在正在尝试了解如何将应用内图像保存到照片中.

                  to save a picture taken with the camera to Photos, I am now trying to find out how to save an in-App image to Photos.

                  考虑以下 PhoneGap - Cordova 页面,其中元素 myPhoto 保存图像数据,例如data:image/jpeg;base64,"...

                  Consider the following PhoneGap - Cordova page where the element myPhoto holds imagedata such as "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>
                  

                  问题:

                  savePicture() 应该如何通过 Phonegap 将 myPhoto 中的图像数据保存到 iOS 中的照片?

                  What should savePicture() do to save the imagedata from myPhoto to Photos in iOS via Phonegap?

                  推荐答案

                  我最近遇到了以下 Phonegap 插件,用于在 iOS 中将 Canvas 图像保存到照片:https://github.com/devgeeks/Canvas2ImagePlugin

                  I recently came across the following Phonegap plugin for saving Canvas images to Photos in iOS: https://github.com/devgeeks/Canvas2ImagePlugin

                  按照自述文件 instructions 导入插件,然后您就可以使用方法如下:

                  Follow the readme instructions for importing the plugin and then you can use it the following way:

                  <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" src="../Canvas2Image/Canvas2ImagePlugin.js"></script>
                          <script type="text/javascript" charset="utf-8">
                  
                          var canvas2ImagePlugin; //devgeeks plugin for saving canvas images to photo gallery
                  
                          function onDeviceReady() {
                               canvas2ImagePlugin = window.plugins.canvas2ImagePlugin;
                           }
                  
                          function savePicture(){
                              canvas2ImagePlugin.saveImageDataToLibrary(function(msg){console.log(msg);},function(err){console.log(err);},'mycanvas');
                           }
                  
                          </script>
                      </head>
                      <body>
                          <canvas id="myCanvas" width="500px" height="300px"> <strong>[Your browser can not show this example.]</strong> </canvas>
                          <button onclick="savePicture();">Save Photo</button> <br>
                      </body>
                  </html>
                  

                  这篇关于通过 PhoneGap 将 PNG 或 JPG 图像保存到 iOS 中的照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  what#39;s property copy means in Cocoa#39;s Framework?(like UITabBar#39;s items property)(Cocoa 框架中的属性副本是什么意思?(如 UITabBar 的 items 属性))
                  Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)
                  Automatically copy property values from one object to another of a different type but the same protocol (Objective-C)(自动将属性值从一个对象复制到另一个类型不同但协议相同的对象 (Objective-C))
                  Android copy image from gallery folder onto SD Card alternative folder(Android将图像从图库文件夹复制到SD卡替代文件夹)
                  Copy text to clipboard with iOS(使用 iOS 将文本复制到剪贴板)
                  How to copy text to clipboard/pasteboard with Swift(如何使用 Swift 将文本复制到剪贴板/粘贴板)

                          <tbody id='wOpZA'></tbody>
                      1. <tfoot id='wOpZA'></tfoot>

                      2. <i id='wOpZA'><tr id='wOpZA'><dt id='wOpZA'><q id='wOpZA'><span id='wOpZA'><b id='wOpZA'><form id='wOpZA'><ins id='wOpZA'></ins><ul id='wOpZA'></ul><sub id='wOpZA'></sub></form><legend id='wOpZA'></legend><bdo id='wOpZA'><pre id='wOpZA'><center id='wOpZA'></center></pre></bdo></b><th id='wOpZA'></th></span></q></dt></tr></i><div id='wOpZA'><tfoot id='wOpZA'></tfoot><dl id='wOpZA'><fieldset id='wOpZA'></fieldset></dl></div>
                          <bdo id='wOpZA'></bdo><ul id='wOpZA'></ul>

                            <small id='wOpZA'></small><noframes id='wOpZA'>

                            <legend id='wOpZA'><style id='wOpZA'><dir id='wOpZA'><q id='wOpZA'></q></dir></style></legend>