How to use nativescript-imagecropper - 3 common examples

To help you get started, we’ve selected a few nativescript-imagecropper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anihalaney / rwa-trivia / projects / trivia / src / app / user / components / profile-settings / profile-settings.component.tns.ts View on Github external
async cropImage(imageSource) {
    try {
      const imageCropper: ImageCropper = new ImageCropper();
      const result: ImageSource = (await imageCropper.show(imageSource,
      {width: 150, height: 140, lockSquare: false})).image;
      if (result) {
        this.profileImage.image = `data:image/jpeg;base64,${result.toBase64String('jpeg', 100)}`;
        this.saveProfileImage();
        this.cd.detectChanges();
      }
    } catch (error) {
      console.error(error);
    }
  }
github bthurlow / nativescript-imagecropper / ns-vue-demo / vue-snippet.js View on Github external
source.fromAsset(imageAsset).then((picture) => {
					var imageCropper = new ImageCropper();
					imageCropper.show(picture).then(function(args){
						self.image_src = args.image;
					})
					.catch(function(e){
						console.log(e);
					});
				});
			}).catch((err) => {
github bthurlow / nativescript-imagecropper / demo / app / main-view-model.ts View on Github external
constructor() {
        super();

        this.imageCropper = new ImageCropper();

        setTimeout(() => {
            this.croppedImage = frameModule.topmost().getViewById("croppedImage");
        }, 1000);
    }

nativescript-imagecropper

NativeScript Image Cropper Plugin

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Popular nativescript-imagecropper functions