Yes you can do it by using Canvas. Here an Example:
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
@Component({
selector: "canvas-component"
,templateUrl: "./canvas.template.html"
})
export class CanvasScene implements AfterViewInit, IScene {
//Loading Canvas and Images html elements
@ViewChild('myCanvas') canvasRef: ElementRef;
@ViewChild('bubbleimg') bubble_img: ElementRef
//Canvas Context
ctx: CanvasRenderingContext2D;
ngOnInit() {
this.ctx = this.canvasRef.nativeElement.getContext('2d');
this.paint(this.ctx);
}
paint(ctx) {
ctx.drawImage(this.bubble_img, 0, 0, 70, 50);
//FrameRate To Repaint
setTimeout(() =>
{
this.paint(ctx);
},
100);
}
HTML CODE
<canvas #myCanvas style="width:100%" >
</canvas>
<img #bubbleimg src="assets/bubble.png">
UPDATED for Angular 8+
Replace
@ViewChild('myCanvas') canvasRef: ElementRef;
@ViewChild('bubbleimg') bubble_img: ElementRef
to this:
@ViewChild('myCanvas', {static: false}) canvasRef: ElementRef;
@ViewChild('bubbleimg', {static: false}) bubble_img: ElementRef
Read more about this feature here