2020-06-27 03:06:51 +02:00
|
|
|
export class Img {
|
2020-08-08 17:50:43 +02:00
|
|
|
|
2020-11-06 03:17:27 +01:00
|
|
|
public static runningFromConsole = false;
|
|
|
|
|
2020-11-05 12:28:02 +01:00
|
|
|
static AsData(source:string){
|
2020-11-06 03:17:27 +01:00
|
|
|
if(this.runningFromConsole){
|
|
|
|
return source;
|
|
|
|
}
|
2020-11-05 12:28:02 +01:00
|
|
|
return `data:image/svg+xml;base64,${(btoa(source))}`;
|
|
|
|
}
|
|
|
|
|
2020-08-08 17:50:43 +02:00
|
|
|
static AsImageElement(source: string): string{
|
2020-11-05 12:28:02 +01:00
|
|
|
return `<img src="${Img.AsData(source)}">`;
|
|
|
|
}
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|
|
|
|
|