Nebulous Program Mechanic

    nativescript-screenshot

    0.0.2 • Public • Published

    NativeScript Screenshot

    This is a plugin for iOS and Android that allows you to get NativeScript view as image.

    Installation

    tns plugin add nativescript-screenshot

    Usage

    <Page>
       <StackLayout loaded="stackLoaded">
         <Button text="Test" tap="buttonTap" />
       </StackLayout>
    </Page>
    var image = require("ui/image");
    var plugin = require("nativescript-screenshot");
     
    var stackLayout;
    exports.stackLoaded = function(args){
      stackLayout = args.object
    }
     
    exports.buttonTap = function(args){
      var img = new image.Image();
      img.imageSource = plugin.getImage(args.object);
      stackLayout.addChild(img);
    }

    Install

    npm i nativescript-screenshot

    DownloadsWeekly Downloads

    1

    Version

    0.0.2

    License

    Apache-2.0

    Last publish

    Collaborators

    • enchev