i need to use the camera for take a photo from user .
i did it , but I have a problem with that .
Decreased photo quality after user take a picture . the quality important for me , because user must take image from text written on the paper and the quality of the image is important .
this is my code for convert video to image :
drawImageToCanvas(image: any, width: number, height: number) {
return this.canvas.nativeElement
.getContext('2d')
.drawImage(image, 0, 0, width, height);
}
takePhoto(): void {
this.drawImageToCanvas(this.video.nativeElement, 400, 400);
this.img = this.canvas.nativeElement.toDataURL('image/png');
console.log(this.canvas.nativeElement.toDataURL('image/png'));
this.DownloadFile(
this.canvas.nativeElement.toDataURL('image/png'),
'image'
);
}
how can keep the quilty of image after take a photo ??