2

I am trying to crop an image after rotation , but unfortunately the crop is being done on original image instead of rotated image. I am using open cv . Here is my code for rotation -

 rotateImage(event) {
var sampleimage = document.getElementById("sample");
console.log(sampleimage.height);
var scope = this;

if (event.target.id === "rotateC") {
  rotate = rotate + 90;
  // sampleimage.style.transform = "rotate(" + rotate + "deg)";
  scope.imageRotate();
}

if (event.target.id === "rotateA") {
  rotate = rotate - 90;
  sampleimage.style.transform = "rotate(" + rotate + "deg)";
}}

Is there a simple solution for the same. Any help will be appreciated.

Vipul Pathak
  • 59
  • 1
  • 5
  • 1
    Check this might help https://stackoverflow.com/questions/19518721/image-crop-after-rotate-by-canvas – Jabir Feb 05 '20 at 07:37

0 Answers0