I want to draw logo or image using cairo on Clutter.Canvas or on St.DrawingArea, I have tried using GdkPixbuf to load image and drawing it using cr.paint() but its not showing desired result.
draw_stuff(canvas, cr, width, height) {
this.lineW = 10;
let r = width/2 - this.lineW/2;
cr.setOperator(Cairo.Operator.CLEAR);
cr.paint();
cr.setOperator(Cairo.Operator.OVER);
cr.translate(width/2, height/2);
let img = GdkPixbuf.Pixbuf.new_from_file('arch.svg');
Gdk.cairo_set_source_pixbuf(cr,img,0,0);
cr.paint();
cr.setSourceRGBA(1,1,1,0.3);
cr.rotate(-Math.PI/2);
cr.save();
cr.setLineWidth(this.lineW);
cr.arc(0,0,r,0,2 * Math.PI);
cr.stroke();
cr.restore();
return true;
}
here is the drawing function for Clutter.Canvas. Desired result nothing is showing, How can I draw images like png,svg on Clutter.Canvas or on St.DrawingArea??