how to convert html response of type image/png in angular
getBase64ImageFromURL(url: string) { return Observable.create((observer: Observer<string>) => { // create an image object let img = new Image(); img.crossOrigin = 'Anonymous'; img.src = url; if (!img.complete) { // This will call another method that will create image from url img.onload = () => { observer.next(this.getBase64Image(img)); observer.complete(); }; img.onerror = (err) => { observer.error(err); }; } else { observer.next(this.getBase64Image(img)); observer.complete(); } });}
Also in HTML:
- execute js with innerhtml
- string to html javascript react
- copyright symbol in html
- html doctype
- name a input submit html
- scrollbar in html div
- bootstrap modal
- head icon html
- multiple forms in the same line html
- input type="file" and display image
- add class in @html.displayfor
- ionic badge
- buton html href
- aligning image to middle in html
- how to make navigation bar in html
- how to import google font
- a href
- html how to close tag
- post request html android
- html telephone
- html semantic tags mozilla
- html href to gmail
- search functionality for html table on text box
- html add vertical space below