Posts

Showing posts with the label camanjs

How to import camanjs in ionic properly?

Image
Clash Royale CLAN TAG #URR8PPP How to import camanjs in ionic properly? I tried to install camanjs on my ionic project. I add to my app module : import * as Caman from 'caman'; add it in provider : @NgModule({ providers: [ Caman ] }) on my home.ts : home.ts import * as Caman from 'caman'; addBrightness(){ Caman('#caman-image', function () { this.brightness(50).render(); }); } getPicture(sourceType:PictureSourceType) { this.camera.getPicture({ quality: 100, destinationType: this.camera.DestinationType.DATA_URL, sourceType: sourceType, allowEdit: true, saveToPhotoAlbum: false, correctOrientation: true }).then((imageData) => { this.selectedImage = `data:image/jpeg;base64,${imageData}`; }); } and in my home.html : home.html <button ion-button full (click)="addBrightness()" [disabled]="!selectedImage">Add Brightness</button> <img [src]="select...