# Seek help on displaying svg file content onto screen using Rsvg and Cairo/Gtk

**URL:** <https://discourse.julialang.org/t/seek-help-on-displaying-svg-file-content-onto-screen-using-rsvg-and-cairo-gtk/56680>\
**Category:** New to Julia\
**Created:** [March 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/seek-help-on-displaying-svg-file-content-onto-screen-using-rsvg-and-cairo-gtk/56680 "2021-03-07T15:58:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hpw/32/22300_2.png) [@hpw](https://discourse.julialang.org/u/hpw)\
**Post date:** [March 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/seek-help-on-displaying-svg-file-content-onto-screen-using-rsvg-and-cairo-gtk/56680/1 "2021-03-07T15:58:48Z")

</div>

In a custom draw function, I have this snippet:  
when the draw function is called, I can see the  
println messages printed on the REPL.  
But the Gtk window did not show the image from the svg file.

{ I also tried to comment out lines marked by # ?  
Still no image. }

What do I need to change in the code ?

thanks  
HP

* * *

ctx = Gtk.getgc(widget)

…  
r = Rsvg.handle\_new\_from\_file(“/Users/hpwei/julia/pieces/merida/w\_q.svg”)  
d = Rsvg.handle\_get\_dimensions(r)  
cs = Cairo.CairoImageSurface(d.width,d.height,Cairo.FORMAT\_ARGB32);  
c = Cairo.CairoContext(cs); # ?  
Rsvg.handle\_render\_cairo(c,r). # ?

```
println("svg width ", d.width). # this is ok
println("svg height ", d.height)

set_source_surface(ctx, cs, 0, 0) 
paint(ctx). # ?
fill(ctx)

```
