Nativescript Cscreenshot :camera:
This plugin was created so you can take screenshots of views easily and then store it as you like.
this plugin is based on enchev's NativeScript Screenshot nativescript-screenshot
but updated for better stability and angular, vue and react compatibility (still testing vue and react)
Installation
Use the install command:
tns plugin add @enduco/nativescript-cscreenshot
Usage
Just import the plugin in your project and use it like this
using Typescript:
import { Cscreenshot } from "@enduco/nativescript-cscreenshot";
import { ImageSource } from "@nativescript/core";
let screen = new Cscreenshot();
let view = page.getViewById('main');
@ViewChild("main", { static: true }) main: ElementRef;
let view = this.view.nativeElement;
let view = this.$refs.main.nativeView;
screen.take(view, (image: ImageSource)=>{
});
and in your template
<GridLayout id="main" #main ref="main">
</GridLayout>
License
Apache License Version 2.0, January 2004