• Stars
    star
    211
  • Rank 185,987 (Top 4 %)
  • Language
    Java
  • Created over 12 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PhoneGap / Cordova plugin for iOS to save the contents of an HTML canvas to the device's Photo Library

NOTE: This plugin is NOT being actively maintained. Please feel free to fork it and modify it for your needs.

Canvas2ImagePlugin

This plugin allows you to save the contents of an HTML canvas tag to the iOS Photo Library, Android Gallery or WindowsPhone 8 Photo Album from your app.

See an example project using it here: https://github.com/devgeeks/Canvas2ImageDemo - note: this app does not work in wp8.

Installation

For Cordova 3.0.x:

  1. To add this plugin just type: cordova plugin add https://github.com/devgeeks/Canvas2ImagePlugin.git or phonegap local plugin add https://github.com/devgeeks/Canvas2ImagePlugin.git
  2. To remove this plugin type: cordova plugin remove org.devgeeks.Canvas2ImagePlugin or phonegap local plugin remove org.devgeeks.Canvas2ImagePlugin

NOTE: For older versions of Cordova (You will probably have to use tag 0.2.0)

Usage:

Call the window.canvas2ImagePlugin.saveImageDataToLibrary() method using success and error callbacks and the id attribute or the element object of the canvas to save:

Example

<canvas id="myCanvas" width="165px" height="145px"></canvas>
function onDeviceReady()
{
	window.canvas2ImagePlugin.saveImageDataToLibrary(
        function(msg){
            console.log(msg);
        },
        function(err){
            console.log(err);
        },
        document.getElementById('myCanvas')
    );
}

License

The MIT License

Copyright (c) 2011 Tommy-Carlos Williams (http://github.com/devgeeks)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

ExampleHTML5AudioStreaming

Example project showing audio streaming using HTML5 Audio with PhoneGap on iOS - https://build.phonegap.com/apps/242993
JavaScript
164
star
2

PrivacyScreenPlugin

Cordova / PhoneGap plugin that secures your app from displaying a screenshot in task switchers under Android and iOS. Keeps sensitive information private.
Objective-C
102
star
3

grunt-init-cordova

Grunt init template for Apache Cordova cli-generated projects
JavaScript
27
star
4

PhoneListener

PhoneGap / Cordova Android plugin that allows your application to monitor changes in the phone's state (RINGING, OFFHOOK and IDLE) so that you can respond to them appropriately (pause your Media stream, etc).
Java
27
star
5

react-animated-views

A higher order component to make animated page views easier with react-router
JavaScript
20
star
6

VolumeSlider

PhoneGap / Cordova iOS plugin that allows you to add a native volume slider (MPVolumeView) to your app
Objective-C
16
star
7

Canvas2ImageDemo

Demo app for my PhoneGap / Cordova Canvas2ImagePlugin
JavaScript
7
star
8

ExampleAudioStreamer

This is an example of my AudioStreamer plugin in use
JavaScript
6
star
9

tinyvents

A very small and simple lib to attach events to plain JavaScript objects. Inspired by / based on https://github.com/jeromeetienne/microevent.js
JavaScript
5
star
10

echidna.js

Crypton is dead, long live Echidna.js
JavaScript
4
star
11

Notemindr

A Crypton app for creating notes with reminder attached to them
JavaScript
4
star
12

ReadItLaterPlugin

A PhoneGap plugin for iOS for saving a URL to Read It Later (http://readitlaterlist.com)
Objective-C
4
star
13

react-navigation-example

A playground to try and make mobile page navigation better using react
JavaScript
4
star
14

4ZZZ-app

Mobile app for the community radio station 4ZZZfm in Brisbane, QLD Australia
JavaScript
3
star
15

ExampleMobileDevWorkflow

An example of a mobile dev workflow
JavaScript
2
star
16

ChangeAVAudioSessionCategory

Cheap and dirty plugin to change the AVAudioSessionCategory in iOS
Objective-C
2
star
17

jQTouch-theme-for-Android

A very basic beginning of a theme for Android apps using jQTouch
2
star
18

ethernotes

Ethernotes is a zero-knowledge cloud-based notes app powered by Crypton
JavaScript
2
star
19

pixfor-vulnerable

intentionally vulnerable app for PGDay US 2016 Security and Privacy workshop
JavaScript
1
star
20

phonegap-topcoat-react-getting-started

1
star
21

presentation--none-of-the-above

Slides for my talk at the Melbourne Mobile meetup JavaScript UI Faceoff - "None of the above"
JavaScript
1
star