import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';


@Component({
  selector: 'app-preview-photo',
  templateUrl: './preview-photo.page.html',
  styleUrls: ['./preview-photo.page.scss'],
})
export class PreviewPhotoPage implements OnInit {

  constructor(private modalController: ModalController,
              private navParams:NavParams) { }

  ngOnInit() {
  }

  image: any;
  
  exit(  ){ this.modalController.dismiss()

  }
  save(img){
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext('2d');
    canvas.width=300
    canvas.height=234
    ctx.drawImage(img.attachments[0].image_url, 0, 0, 300, 234);
    document.body.appendChild(canvas);
}
  

}
