Building apps at a large company? Check out Ionic Enterprise

Screenshot

Improve this doc

Captures a screen shot

Repo: https://github.com/gitawego/cordova-screenshot

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add com.darktalker.cordova.screenshot
    $ npm install --save @ionic-native/screenshot
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Screenshot } from '@ionic-native/screenshot';

constructor(private screenshot: Screenshot) { }

...

// Take a screenshot and save to file
this.screenshot.save('jpg', 80, 'myscreenshot.jpg').then(onSuccess, onError);

// Take a screenshot and get temporary file URI
this.screenshot.URI(80).then(onSuccess, onError);

Instance Members

save(format, quality, filename)

Takes screenshot and saves the image

Param Type Details
format string

Format can take the value of either 'jpg' or 'png' On ios, only 'jpg' format is supported

quality number

Determines the quality of the screenshot. Default quality is set to 100.

filename string

Name of the file as stored on the storage

Returns: Promise<any>

URI(quality)

Takes screenshot and returns the image as an URI

Param Type Details
quality number

Determines the quality of the screenshot. Default quality is set to 100.

Returns: Promise<any>

API

Native

General