UNPKG

nativescript-cscreenshot

Version:
17 lines 633 B
import { Common } from './cscreenshot.common'; import { ImageSource } from '@nativescript/core'; export class Cscreenshot extends Common { constructor() { super(); } take(view, callback) { let androidView = view.android; let bmp = android.graphics.Bitmap.createBitmap(androidView.getWidth(), androidView.getHeight(), android.graphics.Bitmap.Config.ARGB_8888); let c = new android.graphics.Canvas(bmp); androidView.draw(c); let native = new ImageSource(); native.setNativeSource(bmp); callback(native); } } //# sourceMappingURL=cscreenshot.android.js.map