This library was generated with Angular CLI version 9.0.3.
This library exists because the management of images, <canvas>
, <svg>
and base64 is not optimal with javascript or angular.
With this library Angular you can manage your <img>
tags, image conversion to base64, canvas conversion to base64, svg tag conversion to base64
Note: This library is in development, it is not yet finished
Add import NgxImageConvertorService
to top your component.ts
:
import {NgxImageConvertorService} from "ngx-image-convertor";
Inject NgxImageConvertorService
to the constructor of your component.ts
:
constructor(private imageConvertorService: NgxImageConvertorService) {}
this.imageConvertorService.convertSvgByIdToBase64( id_of_your_SVG_tag: string, width_of_base64_ouput: number, height_of_base64_ouput: number, output_format: string,
(base64) => {
console.log(base64);
}
);